Skip to content

Conversation

@LiquidityC
Copy link
Member

@LiquidityC LiquidityC commented Oct 10, 2025

  • Adds new animation for shield bash
  • Render player current room on big map

Summary by CodeRabbit

  • New Features
    • Minimap now uses a base map plus overlay for clearer, layered visuals.
    • Current room is highlighted with improved color and positioning for better readability.
    • Pre-rendered minimap textures reduce on-the-fly computation, improving smoothness during gameplay.
    • Final minimap composition draws both base and overlay for a more polished look.

@coderabbitai
Copy link

coderabbitai bot commented Oct 10, 2025

Walkthrough

Introduces a separate minimap overlay texture alongside the base minimap texture, adds a helper to create blank minimap sprites, updates rendering to pre-render base and overlay, adjusts current-room calculations/colors, changes gui_render_minimap to no longer take RoomMatrix, and updates its call site. Adds Gui::miniMapOverlay.

Changes

Cohort / File(s) Summary
Minimap rendering internals
src/gui.c
Added static helper to create blank minimap sprite; created and managed two textures: miniMap (base) and miniMapOverlay; split render targets for base and overlay in gui_update_minimap; gui_render_minimap now composites both textures; adjusted current-room square computation and color; updated overlay composition flow.
Public API and struct
src/gui.h
Added Sprite *miniMapOverlay to struct Gui; changed gui_render_minimap(Gui*, Camera*, RoomMatrix*)gui_render_minimap(Gui*, Camera*).
Call site update
src/main.c
Updated render_gui to call gui_render_minimap(gGui, gCamera) without gRoomMatrix.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GameLoop
  participant Gui
  participant RenderTarget as Base Texture (miniMap)
  participant OverlayTarget as Overlay Texture (miniMapOverlay)
  participant Screen

  GameLoop->>Gui: gui_update_minimap()
  rect rgba(200,220,255,0.25)
    note over Gui,RenderTarget: Pre-render base minimap
    Gui->>RenderTarget: Set as render target
    Gui->>RenderTarget: Draw rooms/visited tiles
    Gui-->>RenderTarget: Unset render target
  end

  rect rgba(220,255,220,0.25)
    note over Gui,OverlayTarget: Pre-render overlay
    Gui->>OverlayTarget: Set as render target
    Gui->>OverlayTarget: Draw current room marker, overlay
    Gui-->>OverlayTarget: Unset render target
  end

  GameLoop->>Gui: gui_render_minimap(cam)
  Note over Gui: Composition uses pre-rendered textures (no RoomMatrix)
  Gui->>Screen: Draw miniMap
  Gui->>Screen: Draw miniMapOverlay
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

A rabbit maps the dungeon’s hue,
Two sprites now dance: base and view.
An overlay whispers, “Here you are,”
While rooms glow softly from afar.
No matrix passed—just hop and see,
The minimap’s duet in harmony.
(_(_) ✨ )_)/

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary functional change of rendering the current room on the map and aligns with the stated objective of the pull request, making it clear and specific without extraneous detail.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch map_player_pos

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22d5593 and 19454ab.

📒 Files selected for processing (3)
  • src/gui.c (4 hunks)
  • src/gui.h (2 hunks)
  • src/main.c (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/main.c (1)
src/gui.c (1)
  • gui_render_minimap (559-564)
src/gui.h (1)
src/gui.c (1)
  • gui_render_minimap (559-564)
src/gui.c (2)
src/sprite.c (1)
  • sprite_render (227-275)
src/texture.c (6)
  • texture_create (27-41)
  • texture_create_blank (43-55)
  • texture_set_blend_mode (227-232)
  • texture_set_scale_mode (234-239)
  • texture_set_alpha (241-246)
  • texture_render_clip_ex (285-315)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Ubuntu (Clang)
  • GitHub Check: Ubuntu (GCC)
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Mac (Clang)
  • GitHub Check: Windows (MSVC)
  • GitHub Check: Ubuntu (mingw)
  • GitHub Check: Mac (GCC)
🔇 Additional comments (7)
src/main.c (1)

1014-1014: LGTM!

The updated call correctly reflects the new gui_render_minimap signature that no longer requires the RoomMatrix parameter.

src/gui.h (1)

54-54: LGTM!

The new miniMapOverlay field enables dual-texture minimap composition as described in the PR objectives.

src/gui.c (5)

106-127: LGTM!

The helper function properly initializes a blank minimap sprite with the correct texture access mode, blend mode, and scale mode for rendering.


219-220: LGTM!

Both minimap sprites are correctly initialized using the new helper function.


559-564: LGTM!

The function signature correctly matches the updated declaration in gui.h, and both minimap sprites are rendered in sequence.


573-581: LGTM!

The overlay rendering correctly displays both the base minimap texture and the overlay texture with proper alpha blending.


543-557: Verify minimap highlight color contrast

  • Coordinate calculations for current room and modifier box follow rm->roomPos.* * MAP_ROOM_*, matching existing code, so the offset removal is correct.
  • Confirm the yellowish highlight (235,235,52,200) offers sufficient contrast against the minimap background.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@LiquidityC LiquidityC changed the title map player pos Render current room on big map Oct 10, 2025
@LiquidityC LiquidityC enabled auto-merge (squash) October 10, 2025 10:38
@LiquidityC LiquidityC merged commit 2598f1e into dev Oct 10, 2025
10 checks passed
@LiquidityC LiquidityC deleted the map_player_pos branch October 10, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants