OpenUT99-Plus
Unreal Engine 1, rebuilt from scratch
Loading...
Searching...
No Matches
script.h
Go to the documentation of this file.
1// Script objects: bytecode walker and class objects (defaults). Spec: docs/formats/script.md; reference: tools/uscript.py
2#pragma once
3#include <cstdint>
4#include <vector>
5
6#include "upkg.h"
7
8namespace ut {
9
10// Walks bytecode at pos until its in-memory size reaches mem_size; returns the end offset. Throws on unknown tokens
11// or if the size does not land on a token boundary. If memory is set, appends the in-memory form (object refs and
12// names as 4-byte little-endian ints, so jump offsets point into it).
13size_t skip_script(const Package& p, size_t pos, uint32_t mem_size, std::vector<uint8_t>* memory = nullptr);
14
15struct ClassInfo {
16 int32_t super_ref = 0; // object ref of the parent class
17 std::vector<Property> defaults;
18};
19
20ClassInfo read_class(const Package& p, const Export& cls); // export with class_ref 0
21
22} // namespace ut
Definition collision.cpp:7
size_t skip_script(const Package &p, size_t pos, uint32_t mem_size, std::vector< uint8_t > *memory)
Definition script.cpp:100
ClassInfo read_class(const Package &p, const Export &cls)
Definition script.cpp:107
Definition script.h:15
int32_t super_ref
Definition script.h:16
std::vector< Property > defaults
Definition script.h:17
Definition upkg.h:32
Definition upkg.h:39