Skip to content

Commit

Permalink
Fix incorrect signature
Browse files Browse the repository at this point in the history
  • Loading branch information
ACrazyTown committed Aug 16, 2024
1 parent fddf985 commit f6fad1e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
18 changes: 10 additions & 8 deletions project/src/media/openal/OpenALBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2301,32 +2301,34 @@ namespace lime {
}


bool lime_alc_is_extension_present (HxString extname) {
HL_PRIM bool HL_NAME(hl_al_is_extension_present) (hl_vstring* extname) {

#ifdef LIME_OPENALSOFT
return alcIsExtensionPresent (extname.__s);
return alIsExtensionPresent (extname ? hl_to_utf8 (extname->bytes) : NULL);
#else
return false;
#endif

}


HL_PRIM bool HL_NAME(hl_al_is_extension_present) (hl_vstring* extname) {
bool lime_alc_is_extension_present (value device, HxString extname) {

#ifdef LIME_OPENALSOFT
return alIsExtensionPresent (extname ? hl_to_utf8 (extname->bytes) : NULL);
ALCdevice* alcDevice = (ALCdevice*)val_data (device);
return alcIsExtensionPresent (alcDevice, extname.__s);
#else
return false;
#endif

}


HL_PRIM bool HL_NAME(hl_alc_is_extension_present) (hl_vstring* extname) {
HL_PRIM bool HL_NAME(hl_alc_is_extension_present) (HL_CFFIPointer* device, hl_vstring* extname) {

#ifdef LIME_OPENALSOFT
return alcIsExtensionPresent (extname ? hl_to_utf8 (extname->bytes) : NULL);
ALCdevice* alcDevice = (ALCdevice*)device->ptr;
return alcIsExtensionPresent (alcDevice, extname ? hl_to_utf8 (extname->bytes) : NULL);
#else
return false;
#endif
Expand Down Expand Up @@ -3602,7 +3604,7 @@ namespace lime {
DEFINE_PRIME1 (lime_al_is_effect);
DEFINE_PRIME1 (lime_al_is_enabled);
DEFINE_PRIME1 (lime_al_is_extension_present);
DEFINE_PRIME1 (lime_alc_is_extension_present);
DEFINE_PRIME2 (lime_alc_is_extension_present);
DEFINE_PRIME1 (lime_al_is_filter);
DEFINE_PRIME1 (lime_al_is_source);
DEFINE_PRIME4v (lime_al_listener3f);
Expand Down Expand Up @@ -3727,7 +3729,7 @@ namespace lime {
DEFINE_HL_PRIM (_BOOL, hl_al_is_effect, _TCFFIPOINTER);
DEFINE_HL_PRIM (_BOOL, hl_al_is_enabled, _I32);
DEFINE_HL_PRIM (_BOOL, hl_al_is_extension_present, _STRING);
DEFINE_HL_PRIM (_BOOL, hl_alc_is_extension_present, _STRING);
DEFINE_HL_PRIM (_BOOL, hl_alc_is_extension_present, _TCFFIPOINTER _STRING);
DEFINE_HL_PRIM (_BOOL, hl_al_is_filter, _TCFFIPOINTER);
DEFINE_HL_PRIM (_BOOL, hl_al_is_source, _TCFFIPOINTER);
DEFINE_HL_PRIM (_VOID, hl_al_listener3f, _I32 _F32 _F32 _F32);
Expand Down
8 changes: 4 additions & 4 deletions src/lime/_internal/backend/native/NativeCFFI.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ class NativeCFFI

@:cffi private static function lime_al_is_extension_present(extname:String):Bool;

@:cffi private static function lime_alc_is_extension_present(extname:String):Bool;
@:cffi private static function lime_alc_is_extension_present(device:CFFIPointer, extname:String):Bool;

@:cffi private static function lime_al_is_source(source:CFFIPointer):Bool;

Expand Down Expand Up @@ -1762,7 +1762,7 @@ class NativeCFFI
private static var lime_al_is_enabled = new cpp.Callable<Int->Bool>(cpp.Prime._loadPrime("lime", "lime_al_is_enabled", "ib", false));
private static var lime_al_is_extension_present = new cpp.Callable<String->Bool>(cpp.Prime._loadPrime("lime", "lime_al_is_extension_present", "sb",
false));
private static var lime_alc_is_extension_present = new cpp.Callable<String->Bool>(cpp.Prime._loadPrime("lime", "lime_alc_is_extension_present", "sb",
private static var lime_alc_is_extension_present = new cpp.Callable<cpp.Object->String->Bool>(cpp.Prime._loadPrime("lime", "lime_alc_is_extension_present", "osb",
false));
private static var lime_al_is_source = new cpp.Callable<cpp.Object->Bool>(cpp.Prime._loadPrime("lime", "lime_al_is_source", "ob", false));
private static var lime_al_listener3f = new cpp.Callable<Int->cpp.Float32->cpp.Float32->cpp.Float32->cpp.Void>(cpp.Prime._loadPrime("lime",
Expand Down Expand Up @@ -1903,7 +1903,7 @@ class NativeCFFI
private static var lime_al_is_buffer = CFFI.load("lime", "lime_al_is_buffer", 1);
private static var lime_al_is_enabled = CFFI.load("lime", "lime_al_is_enabled", 1);
private static var lime_al_is_extension_present = CFFI.load("lime", "lime_al_is_extension_present", 1);
private static var lime_alc_is_extension_present = CFFI.load("lime", "lime_alc_is_extension_present", 1);
private static var lime_alc_is_extension_present = CFFI.load("lime", "lime_alc_is_extension_present", 2);
private static var lime_al_is_source = CFFI.load("lime", "lime_al_is_source", 1);
private static var lime_al_listener3f = CFFI.load("lime", "lime_al_listener3f", 4);
private static var lime_al_listener3i = CFFI.load("lime", "lime_al_listener3i", 4);
Expand Down Expand Up @@ -2185,7 +2185,7 @@ class NativeCFFI
return false;
}

@:hlNative("lime", "hl_alc_is_extension_present") private static function lime_alc_is_extension_present(extname:String):Bool
@:hlNative("lime", "hl_alc_is_extension_present") private static function lime_alc_is_extension_present(device:CFFIPointer, extname:String):Bool
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lime/media/openal/ALC.hx
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ class ALC
#end
}

public static function isExtensionPresent(extname:String):Bool
public static function isExtensionPresent(device:ALDevice, extname:String):Bool
{
#if (lime_cffi && lime_openal && !macro)
return NativeCFFI.lime_alc_is_extension_present(extname);
return NativeCFFI.lime_alc_is_extension_present(device, extname);
#else
return false;
#end
Expand Down

0 comments on commit f6fad1e

Please sign in to comment.