-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathArrayExample.cpp
More file actions
43 lines (33 loc) · 993 Bytes
/
ArrayExample.cpp
File metadata and controls
43 lines (33 loc) · 993 Bytes
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
#include "ArrayExample.h"
#define DEGREES 180 / PI
namespace MyPluginNamespace {
/* application logic */
UInt32 someFunction(SomeData d, MoreData a) {
return 1;
}
/* SKSE wrapper */
UInt32 SKSEWrapper(StaticFunctionTag *base, VMArray<float> d, VMArray<float> a) {
gLog.SetLogLevel(IDebugLog::kLevel_Message);
// SomeData
float scale;
float scaleMe;
float width;
// MoreData
float facing;
float headingAngle;
float ax;
d.Get(&scale, 0);
d.Get(&scaleMe, 1);
d.Get(&width, 2);
a.Get(&facing, 0);
a.Get(&headingAngle, 1);
a.Get(&ax, 2);
SomeData someDataStruct(scale, scaleMe, width);
MoreData moreDataStruct(facing, headingAngle, ax);
return someFunction(someDataStruct, moreDataStruct);
}
bool RegisterFuncs(VMClassRegistry* registry) {
registry->RegisterFunction(new NativeFunction2 <StaticFunctionTag, UInt32, VMArray<float>, VMArray<float>>("SKSEWrapper", "SKSEWrapper", MyPluginNamespace::SKSEWrapper, registry));
return true;
}
}