def render_map(console: tcod.Console, gamemap: game.game_map.GameMap) -> None:
    light = tile_graphics[gamemap.tiles]
    light[(gamemap.fire > 0)] = (ord('^'), (255, 255, 255), (204, 34, 0))
    dark = gamemap.memory.copy()
    dark['fg'] //= 2
    dark['bg'] //= 8
    visible = gamemap.visible
    if g.fullbright:
        visible = np.ones_like(visible)
    for entity in sorted(gamemap.entities, key=(lambda x: x.render_order.value)):
        if (not visible[(entity.x, entity.y)]):
            continue
        light[(entity.x, entity.y)]['ch'] = ord(entity.char)
        light[(entity.x, entity.y)]['fg'] = entity.color
    console.rgb[0:gamemap.width, 0:gamemap.height] = np.select(condlist=[visible, gamemap.explored], choicelist=[light, dark], default=dark)
    for entity in sorted(gamemap.entities, key=(lambda x: x.render_order.value)):
        if (not visible[(entity.x, entity.y)]):
            continue
        console.print(entity.x, entity.y, entity.char, fg=entity.color)
    visible.choose((gamemap.memory, light), out=gamemap.memory)
def render_map(console: tcod.Console, gamemap: game.game_map.GameMap) -> None:
    light = tile_graphics[gamemap.tiles]
    light[(gamemap.fire > 0)] = (ord('^'), (255, 255, 255), (204, 34, 0))
    dark = gamemap.memory.copy()
    dark['fg'] //= 2
    dark['bg'] //= 8
    visible = gamemap.visible
    if g.fullbright:
        visible = np.ones_like(visible)
    for entity in sorted(gamemap.entities, key=(lambda x: x.render_order.value)):
        if (not visible[(entity.x, entity.y)]):
            continue
        light[(entity.x, entity.y)]['ch'] = ord(entity.char)
        light[(entity.x, entity.y)]['fg'] = entity.color
    console.rgb[0:gamemap.width, 0:gamemap.height] = np.select(condlist=[visible, gamemap.explored], choicelist=[light, dark], default=dark)
    for entity in sorted(gamemap.entities, key=(lambda x: x.render_order.value)):
        if (not visible[(entity.x, entity.y)]):
            continue
        console.print(entity.x, entity.y, entity.char, fg=entity.color)
    visible.choose((gamemap.memory, light), out=gamemap.memory)