-
-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathUnityPyBoost.cpp
More file actions
47 lines (43 loc) · 1.29 KB
/
UnityPyBoost.cpp
File metadata and controls
47 lines (43 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "Mesh.hpp"
#include "TypeTreeHelper.hpp"
#include "ArchiveStorageDecryptor.hpp"
/* Mesh.py */
static struct PyMethodDef method_table[] = {
{"unpack_vertexdata",
(PyCFunction)unpack_vertexdata,
METH_VARARGS,
"replacement for VertexData to ComponentData in Mesh.ReadVertexData"},
{"read_typetree",
(PyCFunction)read_typetree,
METH_VARARGS | METH_KEYWORDS,
"replacement for TypeTreeHelper.read_typetree"},
{"decrypt_block",
(PyCFunction)decrypt_block,
METH_VARARGS,
"replacement for ArchiveStorageDecryptor.decrypt_block"},
{NULL,
NULL,
0,
NULL} // Sentinel value ending the table
};
// A struct contains the definition of a module
static PyModuleDef UnityPyBoost_module = {
PyModuleDef_HEAD_INIT,
"UnityPyBoost", // Module name
"TODO",
-1, // Optional size of the module state memory
method_table,
NULL, // Optional slot definitions
NULL, // Optional traversal function
NULL, // Optional clear function
NULL // Optional module deallocation function
};
// The module init function
PyMODINIT_FUNC PyInit_UnityPyBoost(void)
{
PyObject *module = PyModule_Create(&UnityPyBoost_module);
add_typetreenode_to_module(module);
return module;
}