Skip to content

Commit

Permalink
Tools: Fix an oversight in the water types analysis script
Browse files Browse the repository at this point in the history
The file list should contain both RSW and GND maps, but unpacking tables with duplicate indices doesn't work the same way in Lua as it does in JavaScript. The end result is that only the GND maps are collected as the previously unpacked keys are overwritten.
  • Loading branch information
rdw-software committed Feb 27, 2024
1 parent 187f8a4 commit 3e6175a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Tools/analyze-water-types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ local FileAnalyzer = require("Tools.FileAnalyzer")
local console = require("console")
local json = require("json")

local table_insert = table.insert

local grfPath = "data.grf"
local grf = RagnarokGRF()
grf:Open(grfPath)

local rswFileList = grf:FindFilesByType("rsw")
local gndFileList = grf:FindFilesByType("gnd")
local fileList = { unpack(rswFileList), unpack(gndFileList) }
local fileList = {}

for index, grfEntry in ipairs(rswFileList) do
table_insert(fileList, grfEntry)
end

for index, grfEntry in ipairs(gndFileList) do
table_insert(fileList, grfEntry)
end

AnimatedWaterPlane.PREALLOCATE_GEOMETRY_BUFFERS = false -- Will run OOM here if preallocating all these buffers

Expand Down

0 comments on commit 3e6175a

Please sign in to comment.