mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
[jsb] Fix that BufferAsset is not bound correctly. (#11695)
* [jsb] Fix that BufferAsset is not bound correctly.
This commit is contained in:
@@ -386,6 +386,12 @@ bool DownloadTask_to_seval(const cc::network::DownloadTask &v, se::Value *ret);
|
||||
//bool nativevalue_to_se(const cc::TypedArray &typedArray, se::Value &to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) // NOLINT
|
||||
|
||||
bool nativevalue_to_se(const cc::ArrayBuffer &arrayBuffer, se::Value &to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) // NOLINT
|
||||
inline bool nativevalue_to_se(cc::ArrayBuffer *arrayBuffer, se::Value &to, se::Object *ctx) { // NOLINT(readability-identifier-naming) // NOLINT
|
||||
if (arrayBuffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return nativevalue_to_se(*arrayBuffer, to, ctx);
|
||||
}
|
||||
|
||||
inline bool nativevalue_to_se(const ccstd::vector<int8_t> &from, se::Value &to, se::Object * /*ctx*/) { // NOLINT(readability-identifier-naming)
|
||||
se::HandleObject array{se::Object::createTypedArray(se::Object::TypedArrayType::INT8, from.data(), from.size())};
|
||||
|
||||
@@ -37,6 +37,9 @@ public:
|
||||
|
||||
inline ArrayBuffer *getBuffer() const { return _buffer; }
|
||||
|
||||
inline void setNativeAssetForJS(ArrayBuffer *buffer) { _buffer = buffer; }
|
||||
inline ArrayBuffer *getNativeAssetForJS() const { return _buffer; }
|
||||
|
||||
ccstd::any getNativeAsset() const override;
|
||||
void setNativeAsset(const ccstd::any &obj) override;
|
||||
bool validate() const override { return _buffer != nullptr; }
|
||||
|
||||
@@ -97,12 +97,13 @@ rename_functions = ICreateInfo::[structInfo=struct],
|
||||
IPassInfoFull::[switch_=switch],
|
||||
Material::[getProperty=_getProperty _props=_propsInternal],
|
||||
EffectAsset::[registerAsset=register],
|
||||
BufferAsset::[getBuffer=buffer],
|
||||
Skeleton::[getBindposes=_getBindposes setBindposes=_setBindposes]
|
||||
|
||||
|
||||
getter_setter= Asset::[_uuid/getUuid/setUuid nativeUrl/getNativeUrl _nativeDep/getNativeDep isDefault/isDefault],
|
||||
ImageAsset::[format url/getUrl?/setUrl?],
|
||||
BufferAsset::[buffer],
|
||||
BufferAsset::[_nativeAsset/getNativeAssetForJS/setNativeAssetForJS],
|
||||
TextureBase::[isCompressed/isCompressed _width:width/getWidth/setWidth _height:height/getHeight/setHeight],
|
||||
SimpleTexture::[mipmapLevel/mipmapLevel],
|
||||
RenderTexture::[window],
|
||||
|
||||
Reference in New Issue
Block a user