unsafe array on lightmaprenderer: could this be possible?

This commit is contained in:
minjaesong
2019-06-08 03:33:56 +09:00
parent 30ae587554
commit 48b4a4455b
2 changed files with 6 additions and 1 deletions

View File

@@ -147,6 +147,7 @@ object LightmapRenderer {
val ypos = y - for_y_start + overscan_open
val xpos = x - for_x_start + overscan_open
// TODO as you can see above, we're already doing a boundary check; try using unsafe here?
return lightmap[ypos][xpos]
//return lightmap[ypos * LIGHTMAP_WIDTH + xpos]
}
@@ -174,6 +175,7 @@ object LightmapRenderer {
val ypos = y - for_y_start + overscan_open
val xpos = x - for_x_start + overscan_open
// TODO as you can see above, we're already doing a boundary check; try using unsafe here?
lightmap[ypos][xpos] = applyFun.invoke(list[ypos][xpos], colour)
//list[ypos * LIGHTMAP_WIDTH + xpos] = applyFun.invoke(list[ypos * LIGHTMAP_WIDTH + xpos], colour)
}