This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
What this function does: | |
Rasterizes a single Field Of View octant on a grid, similar to the way | |
FOV / shadowcasting is implemented in some roguelikes. | |
Clips to bitmap | |
What it DOES NOT do: | |
Subpixel accuracy | |
Antialiasing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clone(object) | |
local lookup_table = {} | |
local function _copy(object) | |
if type(object) ~= "table" then | |
return object | |
elseif lookup_table[object] then | |
return lookup_table[object] | |
end | |
local new_table = {} | |
lookup_table[object] = new_table |