Conversation
- Remove redundant NULL guards in internal functions (skip_whitespace, at_line_end, line_reader_next, line_reader_init, error_context_init) - Rename dispatch functions for clarity: dispatch_element → dispatch_line, dispatch_elements → dispatch_scene_element, dispatch_objects → dispatch_object - Use precise error codes: PARSE_ERR_FORMAT → PARSE_ERR_OVERFLOW for allocation failures (object_list_add, bump_path, line malloc) - Replace io_error boolean with error field carrying specific t_parse_result codes (PARSE_ERR_IO, PARSE_ERR_OVERFLOW) - Remove error_context_set_line/error_context_set_element wrappers, assign fields directly - Simplify line_reader_init to void (cannot fail) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- bvh_vis/ → bvh_debug/, bvh_vis.h → bvh_debug.h - All bvh_vis_ prefixes → bvhd_ (shorter, consistent) - bvh_visualize() → bvhd_run() - Update Makefile SRCS and includes in main.c, render_loop.c Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align with verb-first naming convention used elsewhere. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- intersect_object_new → intersect_object - intersect_cylinder_new → intersect_cylinder - intersect_cone_new → intersect_cone The _new suffix was a migration artifact; the old versions no longer exist, so the suffix adds no value. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align with module-prefixed naming convention (shadow_*). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- format_and_print_vec3 → hud_print_vec3 - render_camera_fov → hud_render_camera_fov - render_light_bright → hud_render_light_bright - render_object_entry → hud_render_object_entry - keyguide_render_content2 → keyguide_render_objects_section (static) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge single-purpose files back into their parent modules to reduce file count and improve locality: - parse_token.c → parser_utils.c (skip_whitespace, at_line_end) - parse_number_utils.c → parse_number.c (parse_int_part, parse_frac_part) - parse_error_msg.c → parse_error.c (error_write_int, get_error_message) - Replace parse_is_digit() with libft's ft_isdigit() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove scene_flags.c: scene_has_ambient, scene_has_camera, scene_set_flag, scene_clear_flag were trivial wrappers around bitwise ops — inline them at call sites - Make object_list_grow() static (only called within object_list.c) - Remove exported prototypes from minirt.h Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move timer_elapsed_us declaration from metrics.h to utils.h - Remove timer_start (callers use gettimeofday directly) - Remove timer_elapsed_ms (unused) - metrics_frame.c: call gettimeofday directly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove debounce_timer_start/reset/stop — these were one-line wrappers around gettimeofday/is_active assignments - Inline timer operations directly at call sites in render_debounce.c - Use timer_elapsed_us from utils.h in debounce_timer_expired and debounce_check_preview_throttle Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- render_scene_to_buffer, create_camera_ray, trace_ray: minirt.h → render.h (render pipeline belongs in render module) - close_window, handle_key, handle_expose: render.h/input.h → mlx_context.h (MLX event callbacks belong with MLX context) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The header defines scene, camera, light, and object types — scene.h better reflects its actual content. Update all 40 source files that included minirt.h. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align header name with its module directory (src/display/). Update include guard and all source files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These are HUD-specific format helpers, not libft extensions — use the hud_ prefix. Move declarations from hud.h (public) to hud_internal.h (module-internal only). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- scene.h: remove transitive includes (libft.h, error.h, ray.h, unistd.h, fcntl.h, stdbool.h) — consumers include what they need - display.h: add mlx.h include (was duplicated in each display/*.c) - render.h: replace mlx.h with ray.h (mlx.h now comes via display.h) - hud_internal.h: replace scene.h with vec3.h + forward declaration of t_render to reduce coupling - Remove redundant includes from 50 source files (scene.h, render.h, mlx.h where already provided transitively by module headers) - Add explicit libft.h/error.h where needed after scene.h cleanup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
모듈/함수 네이밍 일관성 개선, 헤더 정리, include 의존성 최소화 등 전반적인 리팩토링
Related Issue
없음
Type of Change
Changes
모듈/파일 리네임
bvh_vis/→bvh_debug/(bvh_vis_ 접두사 → bvhd_)minirt.h→scene.h(헤더 역할에 맞는 이름)mlx_context.h→display.h(모듈 디렉토리명과 일치)함수 리네임
scene_build_bvh→build_scene_bvh(동사-우선 컨벤션)intersect_object_new등_new접미사 제거 (마이그레이션 잔재)is_in_shadow→shadow_is_occluded(모듈 접두사 통일)hud_접두사 추가 (render_camera_fov→hud_render_camera_fov등)ft_strcpy/ft_itoa_buf→hud_strcpy/hud_itoa_buf(HUD 전용 헬퍼)파서 리팩토링
dispatch_element→dispatch_line등 함수명 명확화PARSE_ERR_FORMAT→PARSE_ERR_OVERFLOW)parse_token.c→parser_utils.c,parse_number_utils.c→parse_number.c,parse_error_msg.c→parse_error.c코드 단순화
scene_flags.c제거: 비트 연산 래퍼 인라인화object_list_grow()static 전환timer_start/timer_elapsed_ms제거,timer_elapsed_us를utils.h로 이동debounce_timer_start/reset/stop래퍼 제거, 직접 대입render.h, event callbacks →display.h)include 의존성 최소화
scene.h에서 불필요한 transitive include 제거 (libft.h, error.h, ray.h 등)display.h에 mlx.h include 추가 (소스 파일 중복 제거)hud_internal.h: scene.h 대신 vec3.h + forward declaration으로 경량화Testing
Test Environment
Test Steps
make re전체 리빌드 성공 확인norminette src/ includes/전체 통과 확인Test Results
Screenshots
해당 없음
Checklist
Constitution Compliance
Performance Impact
Additional Notes
동작 변경 없는 순수 리팩토링입니다. 15개 커밋으로 관심사별 분리하여 리뷰 용이성을 높였습니다.
🤖 Generated with Claude Code