mirror of
https://github.com/Relintai/gdnative_python.git
synced 2024-11-12 10:25:08 +01:00
Removed gdapi11, and 12.
This commit is contained in:
parent
a7d9e11f3d
commit
8d934c94fe
@ -57,7 +57,7 @@ cdef class Array:
|
|||||||
if not iterable:
|
if not iterable:
|
||||||
gdapi10.pandemonium_array_new(&self._gd_data)
|
gdapi10.pandemonium_array_new(&self._gd_data)
|
||||||
elif isinstance(iterable, Array):
|
elif isinstance(iterable, Array):
|
||||||
self._gd_data = gdapi11.pandemonium_array_duplicate(&(<Array>iterable)._gd_data, False)
|
self._gd_data = gdapi10.pandemonium_array_duplicate(&(<Array>iterable)._gd_data, False)
|
||||||
# TODO: handle Pool*Array
|
# TODO: handle Pool*Array
|
||||||
else:
|
else:
|
||||||
gdapi10.pandemonium_array_new(&self._gd_data)
|
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):
|
cdef inline Array operator_getslice(self, pandemonium_int start, pandemonium_int stop, pandemonium_int step):
|
||||||
{{ force_mark_rendered("pandemonium_array_slice") }}
|
{{ force_mark_rendered("pandemonium_array_slice") }}
|
||||||
cdef Array ret = Array.__new__(Array)
|
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
|
return ret
|
||||||
|
|
||||||
# TODO: support slice
|
# TODO: support slice
|
||||||
|
@ -8,8 +8,6 @@ cimport cython
|
|||||||
from pandemonium._hazmat.gdnative_api_struct cimport *
|
from pandemonium._hazmat.gdnative_api_struct cimport *
|
||||||
from pandemonium._hazmat.gdapi cimport (
|
from pandemonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
|
||||||
pythonscript_gdapi12 as gdapi12,
|
|
||||||
)
|
)
|
||||||
from pandemonium._hazmat.conversion cimport *
|
from pandemonium._hazmat.conversion cimport *
|
||||||
from pandemonium.pool_arrays cimport (
|
from pandemonium.pool_arrays cimport (
|
||||||
|
@ -37,7 +37,7 @@ cdef class Dictionary:
|
|||||||
if not iterable:
|
if not iterable:
|
||||||
gdapi10.pandemonium_dictionary_new(&self._gd_data)
|
gdapi10.pandemonium_dictionary_new(&self._gd_data)
|
||||||
elif isinstance(iterable, Dictionary):
|
elif isinstance(iterable, Dictionary):
|
||||||
self._gd_data = gdapi12.pandemonium_dictionary_duplicate(&(<Dictionary>iterable)._gd_data, False)
|
self._gd_data = gdapi10.pandemonium_dictionary_duplicate(&(<Dictionary>iterable)._gd_data, False)
|
||||||
# TODO: handle Pool*Array
|
# TODO: handle Pool*Array
|
||||||
elif isinstance(iterable, dict):
|
elif isinstance(iterable, dict):
|
||||||
gdapi10.pandemonium_dictionary_new(&self._gd_data)
|
gdapi10.pandemonium_dictionary_new(&self._gd_data)
|
||||||
@ -104,7 +104,7 @@ cdef class Dictionary:
|
|||||||
cdef pandemonium_variant var_key
|
cdef pandemonium_variant var_key
|
||||||
if not pyobj_to_pandemonium_variant(key, &var_key):
|
if not pyobj_to_pandemonium_variant(key, &var_key):
|
||||||
raise TypeError(f"Cannot convert `{key!r}` to Pandemonium Variant")
|
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)
|
gdapi10.pandemonium_variant_destroy(&var_key)
|
||||||
if not ret:
|
if not ret:
|
||||||
raise KeyError(key)
|
raise KeyError(key)
|
||||||
@ -134,7 +134,7 @@ cdef class Dictionary:
|
|||||||
cdef pandemonium_variant var_default
|
cdef pandemonium_variant var_default
|
||||||
if default is not None:
|
if default is not None:
|
||||||
pyobj_to_pandemonium_variant(default, &var_default)
|
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)
|
gdapi10.pandemonium_variant_destroy(&var_default)
|
||||||
else:
|
else:
|
||||||
var_ret = gdapi10.pandemonium_dictionary_get(&self._gd_data, &var_key)
|
var_ret = gdapi10.pandemonium_dictionary_get(&self._gd_data, &var_key)
|
||||||
|
@ -52,7 +52,7 @@ cdef class Quaternion:
|
|||||||
# Call to __new__ bypasses __init__ constructor
|
# Call to __new__ bypasses __init__ constructor
|
||||||
cdef Quaternion ret = Quaternion.__new__(Quaternion)
|
cdef Quaternion ret = Quaternion.__new__(Quaternion)
|
||||||
{{ force_mark_rendered("pandemonium_quaternion_new_with_basis") }}
|
{{ 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
|
return ret
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -60,7 +60,7 @@ cdef class Quaternion:
|
|||||||
# Call to __new__ bypasses __init__ constructor
|
# Call to __new__ bypasses __init__ constructor
|
||||||
cdef Quaternion ret = Quaternion.__new__(Quaternion)
|
cdef Quaternion ret = Quaternion.__new__(Quaternion)
|
||||||
{{ force_mark_rendered("pandemonium_quaternion_new_with_euler") }}
|
{{ 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
|
return ret
|
||||||
|
|
||||||
def __repr__(Quaternion self):
|
def __repr__(Quaternion self):
|
||||||
|
@ -75,7 +75,7 @@ cdef class Transform:
|
|||||||
def from_quaternion(Quaternion quat not None):
|
def from_quaternion(Quaternion quat not None):
|
||||||
cdef Transform ret = Transform.__new__(Transform)
|
cdef Transform ret = Transform.__new__(Transform)
|
||||||
{{ force_mark_rendered("pandemonium_transform_new_with_quaternion") }}
|
{{ 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
|
return ret
|
||||||
|
|
||||||
def __repr__(Transform self):
|
def __repr__(Transform self):
|
||||||
|
@ -5,8 +5,6 @@ cimport cython
|
|||||||
|
|
||||||
from pandemonium._hazmat.gdapi cimport (
|
from pandemonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
|
||||||
pythonscript_gdapi12 as gdapi12,
|
|
||||||
)
|
)
|
||||||
from pandemonium._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
{% for t in types %}
|
{% for t in types %}
|
||||||
|
@ -6,8 +6,6 @@ from libc.stdint cimport uintptr_t
|
|||||||
|
|
||||||
from pandemonium._hazmat.gdapi cimport (
|
from pandemonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
|
||||||
pythonscript_gdapi12 as gdapi12,
|
|
||||||
)
|
)
|
||||||
from pandemonium._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
{% for t in types %}
|
{% for t in types %}
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
from pandemonium._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_gdnative_core_api_struct,
|
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_nativescript_api_struct,
|
||||||
pandemonium_gdnative_ext_pluginscript_api_struct,
|
pandemonium_gdnative_ext_pluginscript_api_struct,
|
||||||
pandemonium_gdnative_ext_android_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
|
# define PYTHONSCRIPT_IMPORT
|
||||||
#endif
|
#endif
|
||||||
PYTHONSCRIPT_IMPORT extern const pandemonium_gdnative_core_api_struct *pythonscript_gdapi10;
|
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_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_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_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_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_nativescript_api_struct *pythonscript_gdapi_ext_nativescript
|
||||||
cdef const pandemonium_gdnative_ext_pluginscript_api_struct *pythonscript_gdapi_ext_pluginscript
|
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_android_api_struct *pythonscript_gdapi_ext_android
|
||||||
cdef const pandemonium_gdnative_ext_arvr_api_struct *pythonscript_gdapi_ext_arvr
|
|
||||||
|
@ -4,12 +4,9 @@ from pandemonium._hazmat cimport gdnative_api_struct
|
|||||||
# Re-expose Pandemonium API with better names
|
# Re-expose Pandemonium API with better names
|
||||||
from pandemonium._hazmat.gdapi cimport (
|
from pandemonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
|
||||||
pythonscript_gdapi12 as gdapi12,
|
|
||||||
pythonscript_gdapi_ext_nativescript as gdapi_ext_nativescript,
|
pythonscript_gdapi_ext_nativescript as gdapi_ext_nativescript,
|
||||||
pythonscript_gdapi_ext_pluginscript as gdapi_ext_pluginscript,
|
pythonscript_gdapi_ext_pluginscript as gdapi_ext_pluginscript,
|
||||||
pythonscript_gdapi_ext_android as gdapi_ext_android,
|
pythonscript_gdapi_ext_android as gdapi_ext_android,
|
||||||
pythonscript_gdapi_ext_arvr as gdapi_ext_arvr,
|
|
||||||
)
|
)
|
||||||
from pandemonium._hazmat.conversion cimport (
|
from pandemonium._hazmat.conversion cimport (
|
||||||
pandemonium_string_to_pyobj,
|
pandemonium_string_to_pyobj,
|
||||||
|
@ -75,22 +75,21 @@ static PyThreadState *gilstate = NULL;
|
|||||||
# define PYTHONSCRIPT_EXPORT
|
# define PYTHONSCRIPT_EXPORT
|
||||||
#endif
|
#endif
|
||||||
PYTHONSCRIPT_EXPORT const pandemonium_gdnative_core_api_struct *pythonscript_gdapi10 = NULL;
|
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_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_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_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) {
|
static void _register_gdapi(const pandemonium_gdnative_init_options *options) {
|
||||||
pythonscript_gdapi10 = (const pandemonium_gdnative_core_api_struct *)options->api_struct;
|
pythonscript_gdapi10 = (const pandemonium_gdnative_core_api_struct *)options->api_struct;
|
||||||
|
/*
|
||||||
if (pythonscript_gdapi10->next) {
|
if (pythonscript_gdapi10->next) {
|
||||||
pythonscript_gdapi11 = (const pandemonium_gdnative_core_1_1_api_struct *)pythonscript_gdapi10->next;
|
pythonscript_gdapi11 = (const pandemonium_gdnative_core_1_1_api_struct *)pythonscript_gdapi10->next;
|
||||||
if (pythonscript_gdapi11->next) {
|
if (pythonscript_gdapi11->next) {
|
||||||
pythonscript_gdapi12 = (const pandemonium_gdnative_core_1_2_api_struct *)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++) {
|
for (unsigned int i = 0; i < pythonscript_gdapi10->num_extensions; i++) {
|
||||||
const pandemonium_gdnative_api_struct *ext = pythonscript_gdapi10->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:
|
case GDNATIVE_EXT_ANDROID:
|
||||||
pythonscript_gdapi_ext_android = (const pandemonium_gdnative_ext_android_api_struct *)ext;
|
pythonscript_gdapi_ext_android = (const pandemonium_gdnative_ext_android_api_struct *)ext;
|
||||||
break;
|
break;
|
||||||
case GDNATIVE_EXT_ARVR:
|
|
||||||
pythonscript_gdapi_ext_arvr = (const pandemonium_gdnative_ext_arvr_api_struct *)ext;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -133,11 +129,12 @@ GDN_EXPORT void pandemonium_gdnative_init(pandemonium_gdnative_init_options *opt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for mandatory plugins
|
// Check for mandatory plugins
|
||||||
|
/*
|
||||||
if (!pythonscript_gdapi10 || !pythonscript_gdapi11 || !pythonscript_gdapi12) {
|
if (!pythonscript_gdapi10 || !pythonscript_gdapi11 || !pythonscript_gdapi12) {
|
||||||
GD_ERROR_PRINT("Pandemonium-Python requires GDNative API >= v1.2");
|
GD_ERROR_PRINT("Pandemonium-Python requires GDNative API >= v1.2");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (!pythonscript_gdapi_ext_pluginscript) {
|
if (!pythonscript_gdapi_ext_pluginscript) {
|
||||||
GD_ERROR_PRINT("Pluginscript extension not available");
|
GD_ERROR_PRINT("Pluginscript extension not available");
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user