1 # This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
2 # or any later version. For details on its copyright, license, and warranties,
3 # see the file NOTICE in the root directory of the PlomRogue source package.
7 """Build Thing's FOV map."""
8 from server.config.world_data import world_db, symbols_hide
9 from server.utils import libpr, c_pointer_to_bytearray, c_pointer_to_string
10 t["fovmap"] = bytearray(b'v' * (world_db["MAP_LENGTH"] ** 2))
11 fovmap = c_pointer_to_bytearray(t["fovmap"])
12 m = c_pointer_to_bytearray(world_db["MAP"])
13 hide_string = c_pointer_to_string(symbols_hide)
14 if libpr.build_fov_map(t["T_POSY"], t["T_POSX"], fovmap, m, hide_string):
15 raise RuntimeError("Malloc error in build_fov_Map().")