mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-09 11:05:24 +00:00
[cocos2d-x] Spine 组件所有特性原生平台适配
This commit is contained in:
@@ -44,6 +44,7 @@ const char* ATTRIB_NAME_UV4 = "a_uv4";
|
||||
const char* ATTRIB_NAME_UV5 = "a_uv5";
|
||||
const char* ATTRIB_NAME_UV6 = "a_uv6";
|
||||
const char* ATTRIB_NAME_UV7 = "a_uv7";
|
||||
const char* ATTRIB_NAME_TEXID = "a_texId";
|
||||
|
||||
const size_t ATTRIB_NAME_POSITION_HASH = std::hash<std::string>{}(ATTRIB_NAME_POSITION);
|
||||
const size_t ATTRIB_NAME_NORMAL_HASH = std::hash<std::string>{}(ATTRIB_NAME_NORMAL);
|
||||
@@ -63,6 +64,7 @@ const size_t ATTRIB_NAME_UV4_HASH = std::hash<std::string>{}(ATTRIB_NAME_UV4);
|
||||
const size_t ATTRIB_NAME_UV5_HASH = std::hash<std::string>{}(ATTRIB_NAME_UV5);
|
||||
const size_t ATTRIB_NAME_UV6_HASH = std::hash<std::string>{}(ATTRIB_NAME_UV6);
|
||||
const size_t ATTRIB_NAME_UV7_HASH = std::hash<std::string>{}(ATTRIB_NAME_UV7);
|
||||
const size_t ATTRIB_NAME_TEXID_HASH = std::hash<std::string>{}(ATTRIB_NAME_TEXID);
|
||||
|
||||
Rect Rect::ZERO;
|
||||
|
||||
|
@@ -152,6 +152,7 @@ extern const char* ATTRIB_NAME_UV4;
|
||||
extern const char* ATTRIB_NAME_UV5;
|
||||
extern const char* ATTRIB_NAME_UV6;
|
||||
extern const char* ATTRIB_NAME_UV7;
|
||||
extern const char* ATTRIB_NAME_TEXID;
|
||||
|
||||
extern const size_t ATTRIB_NAME_POSITION_HASH;
|
||||
extern const size_t ATTRIB_NAME_NORMAL_HASH;
|
||||
@@ -171,6 +172,7 @@ extern const size_t ATTRIB_NAME_UV4_HASH;
|
||||
extern const size_t ATTRIB_NAME_UV5_HASH;
|
||||
extern const size_t ATTRIB_NAME_UV6_HASH;
|
||||
extern const size_t ATTRIB_NAME_UV7_HASH;
|
||||
extern const size_t ATTRIB_NAME_TEXID_HASH;
|
||||
|
||||
// vertex attribute type
|
||||
enum class AttribType : uint16_t
|
||||
|
@@ -48,6 +48,21 @@ static uint32_t attrTypeBytes(AttribType attrType)
|
||||
return 0;
|
||||
}
|
||||
|
||||
VertexFormat* VertexFormat::XY_UV_Two_Color_TexId = new VertexFormat(std::vector<Info>({
|
||||
Info(ATTRIB_NAME_POSITION, AttribType::FLOAT32, 2),
|
||||
Info(ATTRIB_NAME_UV0, AttribType::FLOAT32, 2),
|
||||
Info(ATTRIB_NAME_COLOR, AttribType::UINT8, 4, true),
|
||||
Info(ATTRIB_NAME_COLOR0, AttribType::UINT8, 4, true),
|
||||
Info(ATTRIB_NAME_TEXID, AttribType::FLOAT32, 1)
|
||||
}));
|
||||
|
||||
VertexFormat* VertexFormat::XY_UV_Color_TexId = new VertexFormat(std::vector<Info>({
|
||||
Info(ATTRIB_NAME_POSITION, AttribType::FLOAT32, 2),
|
||||
Info(ATTRIB_NAME_UV0, AttribType::FLOAT32, 2),
|
||||
Info(ATTRIB_NAME_COLOR, AttribType::UINT8, 4, true),
|
||||
Info(ATTRIB_NAME_TEXID, AttribType::FLOAT32, 1)
|
||||
}));
|
||||
|
||||
VertexFormat* VertexFormat::XY_UV_Two_Color = new VertexFormat(std::vector<Info>({
|
||||
Info(ATTRIB_NAME_POSITION, AttribType::FLOAT32, 2),
|
||||
Info(ATTRIB_NAME_UV0, AttribType::FLOAT32, 2),
|
||||
|
@@ -166,7 +166,15 @@ public:
|
||||
* Gets total byte size of a vertex
|
||||
*/
|
||||
uint32_t getBytes() const { return _bytes; };
|
||||
|
||||
|
||||
/*
|
||||
* Builtin VertexFormat with 2d position, uv, color, color0, texId attributes
|
||||
*/
|
||||
static VertexFormat* XY_UV_Two_Color_TexId;
|
||||
/*
|
||||
* Builtin VertexFormat with 2d position, uv, color, texId attributes
|
||||
*/
|
||||
static VertexFormat* XY_UV_Color_TexId;
|
||||
/*
|
||||
* Builtin VertexFormat with 2d position, uv, color, color0 attributes
|
||||
*/
|
||||
|
Reference in New Issue
Block a user