Skip to content

Conversation

@LiquidityC
Copy link
Member

@LiquidityC LiquidityC commented Oct 10, 2025

It would only update when entering a previously unvisited room. This is
fixed now.

Summary by CodeRabbit

  • New Features
    • Minimap now includes a clear highlight overlay for the current room, making it easier to orient yourself at a glance.
    • The position indicator refreshes every update cycle for more responsive, real-time feedback during gameplay.
    • Existing minimap visuals remain unchanged; the new overlay sits on top to emphasize your location without altering the base map.

@LiquidityC LiquidityC enabled auto-merge (squash) October 10, 2025 20:21
@coderabbitai
Copy link

coderabbitai bot commented Oct 10, 2025

Walkthrough

Adds a new public function gui_update_minimap_pos for rendering a per-room overlay on the minimap. Updates gui_update_minimap to reset the render target. Integrates gui_update_minimap_pos into the main update loop to refresh the overlay each cycle.

Changes

Cohort / File(s) Summary
GUI API additions
src/gui.h
Declares new public function void gui_update_minimap_pos(Gui *gui, Camera *cam, RoomMatrix *rm); with documentation, placed after gui_update_minimap.
Minimap rendering implementation
src/gui.c
Implements gui_update_minimap_pos that renders the current-room overlay to gui->miniMapOverlay->textures[0]->texture, clearing with transparency and restoring the default render target. Ensures gui_update_minimap ends by resetting the render target to NULL.
Main loop integration
src/main.c
Calls gui_update_minimap_pos(gGui, gCamera, gRoomMatrix) in run_game_update after map_clear_expired_entities and repopulate_roommatrix.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Player
  participant GameLoop as run_game_update
  participant GUI as GUI
  participant Renderer as Render Target

  Player->>GameLoop: Tick
  GameLoop->>GameLoop: map_clear_expired_entities()
  GameLoop->>GameLoop: repopulate_roommatrix()
  GameLoop->>GUI: gui_update_minimap()
  GUI->>Renderer: setTarget(miniMap texture)
  GUI->>Renderer: draw full minimap
  GUI->>Renderer: setTarget(NULL)

  GameLoop->>GUI: gui_update_minimap_pos()
  GUI->>Renderer: setTarget(miniMapOverlay texture)
  GUI->>Renderer: clear transparent + draw room overlay
  GUI->>Renderer: setTarget(NULL)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

A hop, a skip, a minimap glow,
I nudge the room where heroes go.
Overlay bright, I set the scene—
Tiny squares where quests have been.
Thump-thump! my paws applaud the art,
New trail marked on the rabbit’s chart.
(_/)> 🗺️✨

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 clearly and concisely summarizes the primary change—fixing the minimap room indicator so it updates as intended—and avoids vague language or unrelated details.
✨ 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 fix_minmap_cur_room_indicator

📜 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 67d8f3d and afda74a.

📒 Files selected for processing (3)
  • src/gui.c (1 hunks)
  • src/gui.h (1 hunks)
  • src/main.c (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/main.c (2)
src/gui.c (1)
  • gui_update_minimap_pos (546-563)
src/roommatrix.c (2)
  • roommatrix_update (95-108)
  • roommatrix_update_with_player (86-93)
src/gui.h (1)
src/gui.c (1)
  • gui_update_minimap_pos (546-563)
⏰ 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: Mac (Clang)
  • GitHub Check: Ubuntu (mingw)
  • GitHub Check: Ubuntu (Clang)
  • GitHub Check: Windows (MSVC)
  • GitHub Check: Ubuntu (GCC)
  • GitHub Check: Mac (GCC)
  • GitHub Check: Analyze (c-cpp)

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.

It would only update when entering a previously unvisited room. This is
fixed now.
@LiquidityC LiquidityC merged commit 54aaa72 into dev Oct 10, 2025
10 checks passed
@LiquidityC LiquidityC deleted the fix_minmap_cur_room_indicator branch October 10, 2025 20:38
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