0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00
This commit is contained in:
2025-12-28 12:46:14 +01:00
parent 67f081b1a9
commit 5bc1207d55
2 changed files with 9 additions and 3 deletions

View File

@@ -352,6 +352,8 @@ function set_oda_id_data_rds2(oda_id, data) end
---@return integer oda_id ---@return integer oda_id
function register_oda_rds2(aid, data, file_related) end function register_oda_rds2(aid, data, file_related) end
---This function is defined externally
---Loads the file into RFT and initializes it if needed, note that this needs RDR2 mode 2 ---Loads the file into RFT and initializes it if needed, note that this needs RDR2 mode 2
---@param path string ---@param path string
function load_rft_file(path) end ---@param id integer
function load_rft_file(path, id) end

View File

@@ -34,7 +34,11 @@ local function start_rft()
end end
end end
function load_rft_file(path) ---This function is defined externally
---Loads the file into RFT and initializes it if needed, note that this needs RDR2 mode 2
---@param path string
---@param id integer
function load_rft_file(path, id)
local file = io.open(path, "rb") local file = io.open(path, "rb")
if not file then error("Could not open file") end if not file then error("Could not open file") end
_Rft_file = file:read("*a") _Rft_file = file:read("*a")
@@ -42,5 +46,5 @@ function load_rft_file(path)
if #_Rft_file > 262143 then error("The file is too large", 2) end if #_Rft_file > 262143 then error("The file is too large", 2) end
if _Rft_oda_id == nil then start_rft() end if _Rft_oda_id == nil then start_rft() end
---@diagnostic disable-next-line: param-type-mismatch ---@diagnostic disable-next-line: param-type-mismatch
set_oda_id_data_rds2(_Rft_oda_id, #_Rft_file | 0 << 18) set_oda_id_data_rds2(_Rft_oda_id, #_Rft_file | id << 18)
end end