mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
V3.6.2 format return null error fix (#12973)
This commit is contained in:
@@ -1472,15 +1472,19 @@ bool nativevalue_to_se(const cc::gfx::Rect &from, se::Value &to, se::Object * /*
|
||||
// NOLINTNEXTLINE(readability-identifier-naming)
|
||||
bool nativevalue_to_se(const cc::gfx::FormatInfo *from, se::Value &to, se::Object * /*unused*/) {
|
||||
se::HandleObject obj(se::Object::createPlainObject());
|
||||
obj->setProperty("name", se::Value(from->name));
|
||||
obj->setProperty("size", se::Value(from->size));
|
||||
obj->setProperty("count", se::Value(from->count));
|
||||
obj->setProperty("type", se::Value(static_cast<int>(from->type)));
|
||||
obj->setProperty("hasAlpha", se::Value(from->hasAlpha));
|
||||
obj->setProperty("hasDepth", se::Value(from->hasDepth));
|
||||
obj->setProperty("hasStencil", se::Value(from->hasStencil));
|
||||
obj->setProperty("isCompressed", se::Value(from->isCompressed));
|
||||
to.setObject(obj);
|
||||
if (from) {
|
||||
obj->setProperty("name", se::Value(from->name));
|
||||
obj->setProperty("size", se::Value(from->size));
|
||||
obj->setProperty("count", se::Value(from->count));
|
||||
obj->setProperty("type", se::Value(static_cast<int>(from->type)));
|
||||
obj->setProperty("hasAlpha", se::Value(from->hasAlpha));
|
||||
obj->setProperty("hasDepth", se::Value(from->hasDepth));
|
||||
obj->setProperty("hasStencil", se::Value(from->hasStencil));
|
||||
obj->setProperty("isCompressed", se::Value(from->isCompressed));
|
||||
to.setObject(obj);
|
||||
} else {
|
||||
to.setNull();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user