diff --git a/generation/builtins_templates/array.tmpl.pxi b/generation/builtins_templates/array.tmpl.pxi index b904164..931ea0a 100644 --- a/generation/builtins_templates/array.tmpl.pxi +++ b/generation/builtins_templates/array.tmpl.pxi @@ -57,7 +57,7 @@ cdef class Array: if not iterable: gdapi10.pandemonium_array_new(&self._gd_data) elif isinstance(iterable, Array): - self._gd_data = gdapi11.pandemonium_array_duplicate(&(iterable)._gd_data, False) + self._gd_data = gdapi10.pandemonium_array_duplicate(&(iterable)._gd_data, False) # TODO: handle Pool*Array else: gdapi10.pandemonium_array_new(&self._gd_data) @@ -96,7 +96,7 @@ cdef class Array: cdef inline Array operator_getslice(self, pandemonium_int start, pandemonium_int stop, pandemonium_int step): {{ force_mark_rendered("pandemonium_array_slice") }} cdef Array ret = Array.__new__(Array) - ret._gd_data = gdapi12.pandemonium_array_slice(&self._gd_data, start, stop, step, False) + ret._gd_data = gdapi10.pandemonium_array_slice(&self._gd_data, start, stop, step, False) return ret # TODO: support slice diff --git a/generation/builtins_templates/builtins.tmpl.pyx b/generation/builtins_templates/builtins.tmpl.pyx index b2eed6e..0bcdfcf 100644 --- a/generation/builtins_templates/builtins.tmpl.pyx +++ b/generation/builtins_templates/builtins.tmpl.pyx @@ -8,8 +8,6 @@ cimport cython from pandemonium._hazmat.gdnative_api_struct cimport * from pandemonium._hazmat.gdapi cimport ( pythonscript_gdapi10 as gdapi10, - pythonscript_gdapi11 as gdapi11, - pythonscript_gdapi12 as gdapi12, ) from pandemonium._hazmat.conversion cimport * from pandemonium.pool_arrays cimport ( diff --git a/generation/builtins_templates/dictionary.tmpl.pxi b/generation/builtins_templates/dictionary.tmpl.pxi index d13c937..6037932 100644 --- a/generation/builtins_templates/dictionary.tmpl.pxi +++ b/generation/builtins_templates/dictionary.tmpl.pxi @@ -37,7 +37,7 @@ cdef class Dictionary: if not iterable: gdapi10.pandemonium_dictionary_new(&self._gd_data) elif isinstance(iterable, Dictionary): - self._gd_data = gdapi12.pandemonium_dictionary_duplicate(&(iterable)._gd_data, False) + self._gd_data = gdapi10.pandemonium_dictionary_duplicate(&(iterable)._gd_data, False) # TODO: handle Pool*Array elif isinstance(iterable, dict): gdapi10.pandemonium_dictionary_new(&self._gd_data) @@ -104,7 +104,7 @@ cdef class Dictionary: cdef pandemonium_variant var_key if not pyobj_to_pandemonium_variant(key, &var_key): raise TypeError(f"Cannot convert `{key!r}` to Pandemonium Variant") - cdef pandemonium_bool ret = gdapi11.pandemonium_dictionary_erase_with_return(&self._gd_data, &var_key) + cdef pandemonium_bool ret = gdapi10.pandemonium_dictionary_erase_with_return(&self._gd_data, &var_key) gdapi10.pandemonium_variant_destroy(&var_key) if not ret: raise KeyError(key) @@ -134,7 +134,7 @@ cdef class Dictionary: cdef pandemonium_variant var_default if default is not None: pyobj_to_pandemonium_variant(default, &var_default) - var_ret = gdapi11.pandemonium_dictionary_get_with_default(&self._gd_data, &var_key, &var_default) + var_ret = gdapi10.pandemonium_dictionary_get_with_default(&self._gd_data, &var_key, &var_default) gdapi10.pandemonium_variant_destroy(&var_default) else: var_ret = gdapi10.pandemonium_dictionary_get(&self._gd_data, &var_key) diff --git a/generation/builtins_templates/quaternion.tmpl.pxi b/generation/builtins_templates/quaternion.tmpl.pxi index 5f32812..ab0b0e3 100644 --- a/generation/builtins_templates/quaternion.tmpl.pxi +++ b/generation/builtins_templates/quaternion.tmpl.pxi @@ -52,7 +52,7 @@ cdef class Quaternion: # Call to __new__ bypasses __init__ constructor cdef Quaternion ret = Quaternion.__new__(Quaternion) {{ force_mark_rendered("pandemonium_quaternion_new_with_basis") }} - gdapi11.pandemonium_quaternion_new_with_basis(&ret._gd_data, &basis._gd_data) + gdapi10.pandemonium_quaternion_new_with_basis(&ret._gd_data, &basis._gd_data) return ret @staticmethod @@ -60,7 +60,7 @@ cdef class Quaternion: # Call to __new__ bypasses __init__ constructor cdef Quaternion ret = Quaternion.__new__(Quaternion) {{ force_mark_rendered("pandemonium_quaternion_new_with_euler") }} - gdapi11.pandemonium_quaternion_new_with_euler(&ret._gd_data, &euler._gd_data) + gdapi10.pandemonium_quaternion_new_with_euler(&ret._gd_data, &euler._gd_data) return ret def __repr__(Quaternion self): diff --git a/generation/builtins_templates/transform.tmpl.pxi b/generation/builtins_templates/transform.tmpl.pxi index a788f03..1f1db9c 100644 --- a/generation/builtins_templates/transform.tmpl.pxi +++ b/generation/builtins_templates/transform.tmpl.pxi @@ -75,7 +75,7 @@ cdef class Transform: def from_quaternion(Quaternion quat not None): cdef Transform ret = Transform.__new__(Transform) {{ force_mark_rendered("pandemonium_transform_new_with_quaternion") }} - gdapi11.pandemonium_transform_new_with_quaternion(&ret._gd_data, &quat._gd_data) + gdapi10.pandemonium_transform_new_with_quaternion(&ret._gd_data, &quat._gd_data) return ret def __repr__(Transform self): diff --git a/generation/pool_arrays_templates/pool_arrays.tmpl.pxd b/generation/pool_arrays_templates/pool_arrays.tmpl.pxd index 7a0364e..6c3deb9 100644 --- a/generation/pool_arrays_templates/pool_arrays.tmpl.pxd +++ b/generation/pool_arrays_templates/pool_arrays.tmpl.pxd @@ -5,8 +5,6 @@ cimport cython from pandemonium._hazmat.gdapi cimport ( pythonscript_gdapi10 as gdapi10, - pythonscript_gdapi11 as gdapi11, - pythonscript_gdapi12 as gdapi12, ) from pandemonium._hazmat.gdnative_api_struct cimport ( {% for t in types %} diff --git a/generation/pool_arrays_templates/pool_arrays.tmpl.pyx b/generation/pool_arrays_templates/pool_arrays.tmpl.pyx index 4b84f7f..2ee0391 100644 --- a/generation/pool_arrays_templates/pool_arrays.tmpl.pyx +++ b/generation/pool_arrays_templates/pool_arrays.tmpl.pyx @@ -6,8 +6,6 @@ from libc.stdint cimport uintptr_t from pandemonium._hazmat.gdapi cimport ( pythonscript_gdapi10 as gdapi10, - pythonscript_gdapi11 as gdapi11, - pythonscript_gdapi12 as gdapi12, ) from pandemonium._hazmat.gdnative_api_struct cimport ( {% for t in types %} diff --git a/pythonscript/pandemonium/_hazmat/gdapi.pxd b/pythonscript/pandemonium/_hazmat/gdapi.pxd index 8421f64..eb25243 100644 --- a/pythonscript/pandemonium/_hazmat/gdapi.pxd +++ b/pythonscript/pandemonium/_hazmat/gdapi.pxd @@ -1,11 +1,8 @@ from pandemonium._hazmat.gdnative_api_struct cimport ( pandemonium_gdnative_core_api_struct, - pandemonium_gdnative_core_1_1_api_struct, - pandemonium_gdnative_core_1_2_api_struct, pandemonium_gdnative_ext_nativescript_api_struct, pandemonium_gdnative_ext_pluginscript_api_struct, pandemonium_gdnative_ext_android_api_struct, - pandemonium_gdnative_ext_arvr_api_struct, ) @@ -21,18 +18,12 @@ cdef extern from * nogil: # define PYTHONSCRIPT_IMPORT #endif PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_core_api_struct *pythonscript_gdapi10; - PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_core_1_1_api_struct *pythonscript_gdapi11; - PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_core_1_2_api_struct *pythonscript_gdapi12; PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_ext_nativescript_api_struct *pythonscript_gdapi_ext_nativescript; PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_ext_pluginscript_api_struct *pythonscript_gdapi_ext_pluginscript; PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_ext_android_api_struct *pythonscript_gdapi_ext_android; - PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_ext_arvr_api_struct *pythonscript_gdapi_ext_arvr; """ cdef const pandemonium_gdnative_core_api_struct *pythonscript_gdapi10 - cdef const pandemonium_gdnative_core_1_1_api_struct *pythonscript_gdapi11 - cdef const pandemonium_gdnative_core_1_2_api_struct *pythonscript_gdapi12 cdef const pandemonium_gdnative_ext_nativescript_api_struct *pythonscript_gdapi_ext_nativescript cdef const pandemonium_gdnative_ext_pluginscript_api_struct *pythonscript_gdapi_ext_pluginscript cdef const pandemonium_gdnative_ext_android_api_struct *pythonscript_gdapi_ext_android - cdef const pandemonium_gdnative_ext_arvr_api_struct *pythonscript_gdapi_ext_arvr diff --git a/pythonscript/pandemonium/hazmat.pxd b/pythonscript/pandemonium/hazmat.pxd index c899291..f933cdf 100644 --- a/pythonscript/pandemonium/hazmat.pxd +++ b/pythonscript/pandemonium/hazmat.pxd @@ -4,12 +4,9 @@ from pandemonium._hazmat cimport gdnative_api_struct # Re-expose Pandemonium API with better names from pandemonium._hazmat.gdapi cimport ( pythonscript_gdapi10 as gdapi10, - pythonscript_gdapi11 as gdapi11, - pythonscript_gdapi12 as gdapi12, pythonscript_gdapi_ext_nativescript as gdapi_ext_nativescript, pythonscript_gdapi_ext_pluginscript as gdapi_ext_pluginscript, pythonscript_gdapi_ext_android as gdapi_ext_android, - pythonscript_gdapi_ext_arvr as gdapi_ext_arvr, ) from pandemonium._hazmat.conversion cimport ( pandemonium_string_to_pyobj, diff --git a/pythonscript/pythonscript.c b/pythonscript/pythonscript.c index e67f7e5..b9d5f43 100644 --- a/pythonscript/pythonscript.c +++ b/pythonscript/pythonscript.c @@ -75,22 +75,21 @@ static PyThreadState *gilstate = NULL; # define PYTHONSCRIPT_EXPORT #endif PYTHONSCRIPT_EXPORT const pandemonium_gdnative_core_api_struct *pythonscript_gdapi10 = NULL; -PYTHONSCRIPT_EXPORT const pandemonium_gdnative_core_1_1_api_struct *pythonscript_gdapi11 = NULL; -PYTHONSCRIPT_EXPORT const pandemonium_gdnative_core_1_2_api_struct *pythonscript_gdapi12 = NULL; PYTHONSCRIPT_EXPORT const pandemonium_gdnative_ext_nativescript_api_struct *pythonscript_gdapi_ext_nativescript = NULL; PYTHONSCRIPT_EXPORT const pandemonium_gdnative_ext_pluginscript_api_struct *pythonscript_gdapi_ext_pluginscript = NULL; PYTHONSCRIPT_EXPORT const pandemonium_gdnative_ext_android_api_struct *pythonscript_gdapi_ext_android = NULL; -PYTHONSCRIPT_EXPORT const pandemonium_gdnative_ext_arvr_api_struct *pythonscript_gdapi_ext_arvr = NULL; static void _register_gdapi(const pandemonium_gdnative_init_options *options) { pythonscript_gdapi10 = (const pandemonium_gdnative_core_api_struct *)options->api_struct; + /* if (pythonscript_gdapi10->next) { pythonscript_gdapi11 = (const pandemonium_gdnative_core_1_1_api_struct *)pythonscript_gdapi10->next; if (pythonscript_gdapi11->next) { pythonscript_gdapi12 = (const pandemonium_gdnative_core_1_2_api_struct *)pythonscript_gdapi11->next; } } + */ for (unsigned int i = 0; i < pythonscript_gdapi10->num_extensions; i++) { const pandemonium_gdnative_api_struct *ext = pythonscript_gdapi10->extensions[i]; @@ -104,9 +103,6 @@ static void _register_gdapi(const pandemonium_gdnative_init_options *options) { case GDNATIVE_EXT_ANDROID: pythonscript_gdapi_ext_android = (const pandemonium_gdnative_ext_android_api_struct *)ext; break; - case GDNATIVE_EXT_ARVR: - pythonscript_gdapi_ext_arvr = (const pandemonium_gdnative_ext_arvr_api_struct *)ext; - break; default: break; } @@ -133,11 +129,12 @@ GDN_EXPORT void pandemonium_gdnative_init(pandemonium_gdnative_init_options *opt } // Check for mandatory plugins - + /* if (!pythonscript_gdapi10 || !pythonscript_gdapi11 || !pythonscript_gdapi12) { GD_ERROR_PRINT("Pandemonium-Python requires GDNative API >= v1.2"); return; } + */ if (!pythonscript_gdapi_ext_pluginscript) { GD_ERROR_PRINT("Pluginscript extension not available"); return;