• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Xevion / Pac-Man / 17012255828

16 Aug 2025 07:48PM UTC coverage: 38.85% (-12.3%) from 51.196%
17012255828

Pull #3

github

web-flow
Merge 8d73f0bf6 into 2f1ff85d8
Pull Request #3: ECS Refactor

161 of 1172 new or added lines in 23 files covered. (13.74%)

6 existing lines in 3 files now uncovered.

777 of 2000 relevant lines covered (38.85%)

101.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/map/render.rs
1
//! Map rendering functionality.
2

3
use crate::constants::{BOARD_CELL_OFFSET, CELL_SIZE};
4
use crate::map::layout::TILE_MAP;
5
use crate::texture::sprite::{AtlasTile, SpriteAtlas};
6
use sdl2::pixels::Color;
7
use sdl2::rect::Rect;
8
use sdl2::render::{Canvas, RenderTarget};
9

10
/// Handles rendering operations for the map.
11
pub struct MapRenderer;
12

13
impl MapRenderer {
14
    /// Renders the map to the given canvas.
15
    ///
16
    /// This function draws the static map texture to the screen at the correct
17
    /// position and scale.
NEW
18
    pub fn render_map<T: RenderTarget>(canvas: &mut Canvas<T>, atlas: &mut SpriteAtlas, map_tiles: &[AtlasTile]) {
×
19
        for (y, row) in TILE_MAP.iter().enumerate() {
×
20
            for (x, &tile_index) in row.iter().enumerate() {
×
21
                let mut tile = map_tiles[tile_index];
×
22
                tile.color = Some(Color::RGB(0x20, 0x20, 0xf9));
×
23
                let dest = Rect::new(
×
24
                    (BOARD_CELL_OFFSET.x as usize * CELL_SIZE as usize + x * CELL_SIZE as usize) as i32,
×
25
                    (BOARD_CELL_OFFSET.y as usize * CELL_SIZE as usize + y * CELL_SIZE as usize) as i32,
×
26
                    CELL_SIZE,
×
27
                    CELL_SIZE,
×
28
                );
×
29

30
                if let Err(e) = tile.render(canvas, atlas, dest) {
×
31
                    tracing::error!("Failed to render map tile: {}", e);
×
32
                }
×
33
            }
34
        }
35
    }
×
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc