Major rework of extern ref system for WASM, fixes most possible panics in WASM handling
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2023-06-22 15:43:41 +02:00
parent 6a2353df4c
commit 46195d3042
71 changed files with 2142 additions and 1488 deletions

View File

@@ -8,9 +8,9 @@ use paste::paste;
use crate::dynamic_data::{Battle, DynamicLibrary, ExecutingMove, Pokemon, TurnChoice};
use crate::script_implementations::wasm::export_registry::WasmVoidResult;
use crate::script_implementations::wasm::extern_ref::{ExternRef, VecExternRef};
use crate::script_implementations::wasm::extern_ref::ExternRef;
use crate::script_implementations::wasm::script_resolver::WebAssemblyEnvironmentData;
use crate::static_data::{EffectParameter, Item, TypeIdentifier};
use crate::static_data::{Item, TypeIdentifier};
use crate::StringKey;
use wasmer::{FromToNativeWasmType, TypedFunction};
@@ -123,7 +123,7 @@ unsafe impl<T> FromToNativeWasmType for WasmPtr<T> {
script_function_cache! {
stack()
on_remove()
on_initialize(ExternRef<dyn DynamicLibrary>, VecExternRef<EffectParameter>)
on_initialize(ExternRef<dyn DynamicLibrary>, u64)
on_before_turn(ExternRef<TurnChoice>)
change_speed(ExternRef<TurnChoice>, WasmPtr<u32>)
change_priority(ExternRef<TurnChoice>, WasmPtr<i8>)