libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
param_file.hpp
Go to the documentation of this file.
1
8#pragma once
9
11
12#include <cstddef>
13#include <cstdint>
14#include <span>
15
16namespace from {
17namespace param {
24struct param_file {
31 uint32_t _end;
32
37 uint16_t data_offset;
38 uint16_t liber_unknown;
39
45
53 uint16_t row_count;
54
63 uint64_t liber_unknown[3];
64
70 uint64_t liber_unknown;
71
83
89 uintptr_t file_offset;
90
98 uintptr_t file_end;
99 };
100
106 uintptr_t get_file_start() const noexcept {
107 return reinterpret_cast<uintptr_t>(&this->_end);
108 }
109
115 char* get_param_type() const noexcept {
116 return reinterpret_cast<char*>(
117 this->get_file_start() + this->param_type_offset);
118 }
119
125 std::span<param_row_locator> get_param_row_locators() const noexcept {
126 auto first = reinterpret_cast<param_row_locator*>(
127 this->get_file_start() + sizeof(param_file));
128 return std::span<param_row_locator>(first, this->row_count);
129 }
130};
131
145
155
160 alignas(16) param_file file;
161
185
191 std::span<wrapper_row_locator> get_wrapper_row_locators() const noexcept {
192 auto align = this->file.get_file_start() + this->wrapper_data_offset;
193 align = (align + 0xF) & ~0xF;
194 auto first = reinterpret_cast<wrapper_row_locator*>(align);
195 return std::span<wrapper_row_locator>(first, this->row_count);
196 }
197};
198} // namespace param
199} // namespace from
ELDEN RING param defines and enums.
int32_t row_index_type
Signed 32-bit integers are used to represent param row indices.
Definition param_defines.hpp:22
An instance of a structure describing a param table entry later in the file.
Definition param_file.hpp:77
uintptr_t file_offset
The offset (from the start of the file) to this param's row data.
Definition param_file.hpp:89
row_index_type row
The param row index.
Definition param_file.hpp:82
uintptr_t file_end
The offset (from the start of the file) to the end of the file.
Definition param_file.hpp:98
An instance of a structure describing a param entry in the file.
Definition param_file.hpp:166
row_index_type index
The entry index in the param table.
Definition param_file.hpp:183
row_index_type row
The param row index.
Definition param_file.hpp:171
A wrapper for a raw param file in memory used by ELDEN RING.
Definition param_file.hpp:136
std::span< wrapper_row_locator > get_wrapper_row_locators() const noexcept
Get the wrapper row locators in this param file wrapper.
Definition param_file.hpp:191
param_file file
The wrapped param file.
Definition param_file.hpp:160
row_index_type row_count
How many rows there are in the param table.
Definition param_file.hpp:154
uint32_t wrapper_data_offset
The offset (from the start of the file) to the rest of the wrapper's data.
Definition param_file.hpp:144
The layout of a .param file.
Definition param_file.hpp:24
uint32_t _end
The "end" offset, does not always point to valid data.
Definition param_file.hpp:31
uint64_t param_type_offset
Offset of the param type string.
Definition param_file.hpp:62
std::span< param_row_locator > get_param_row_locators() const noexcept
Get the param row locators in this param file.
Definition param_file.hpp:125
uint16_t row_count
How many rows there are in the param table.
Definition param_file.hpp:53
uint16_t paramdef_version
The paramdef version.
Definition param_file.hpp:44
char * get_param_type() const noexcept
Get a pointer to the null terminated param type char string.
Definition param_file.hpp:115
uint16_t data_offset
The short data offset (always 0), purpose is unclear.
Definition param_file.hpp:37
uint64_t param_data_offset
The offset of the raw param data.
Definition param_file.hpp:69
uintptr_t get_file_start() const noexcept
Get the file start as an integer pointer representation.
Definition param_file.hpp:106