重构代码, 移除一些warning

This commit is contained in:
cebgcontract 2022-06-30 17:52:28 +08:00
parent 27b6c0924f
commit eb5c0886bd
2 changed files with 1 additions and 84 deletions

View File

@ -467,10 +467,8 @@
46FDDBFE202ADDCE00931238 /* CCValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDB43202ADDCE00931238 /* CCValue.cpp */; };
46FDDC01202ADDCE00931238 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDB45202ADDCE00931238 /* ccCArray.h */; };
46FDDC02202ADDCE00931238 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDB45202ADDCE00931238 /* ccCArray.h */; };
46FDDC63202D502F00931238 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDC62202D502E00931238 /* CCApplication.h */; };
46FDDC64202D502F00931238 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDC62202D502E00931238 /* CCApplication.h */; };
46FDDC66202D504E00931238 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDC65202D504D00931238 /* CCApplication.h */; };
46FDDC67202D504E00931238 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDC65202D504D00931238 /* CCApplication.h */; };
46FDDC69202D733800931238 /* CCApplication-ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDC68202D733700931238 /* CCApplication-ios.mm */; };
4DC57D211F7A58B5005B6546 /* xxtea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DC57D1F1F7A58B5005B6546 /* xxtea.cpp */; };
4DC57D331F7B840E005B6546 /* xxtea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DC57D1F1F7A58B5005B6546 /* xxtea.cpp */; };
@ -1844,7 +1842,6 @@
469303882046AE05004A3D6C /* HandleObject.hpp in Headers */,
46930466204FE20F004A3D6C /* CCLog.h in Headers */,
4617862720522469008256E1 /* WebSocket.h in Headers */,
46FDDC63202D502F00931238 /* CCApplication.h in Headers */,
469303A42046AE05004A3D6C /* ScriptEngine.hpp in Headers */,
46AE3FF32092F3A600F3A228 /* node.h in Headers */,
1A52DB68205BCDC700350EE3 /* Base.h in Headers */,
@ -2058,7 +2055,6 @@
4648882620AC2BC900CD1E4A /* CCRenderTexture.h in Headers */,
1A29D772205665D200168D9A /* jsb_cocos2dx_manual.hpp in Headers */,
1A29D789205666B200168D9A /* LocalStorage.h in Headers */,
46FDDC67202D504E00931238 /* CCApplication.h in Headers */,
46AE3FE42092F3A600F3A228 /* inspector_agent.h in Headers */,
50ABBD4F1925AB0000A911A9 /* MathUtil.h in Headers */,
1A28FF561F20AFAB007A1D9D /* SRIOConsumerPool.h in Headers */,
@ -2139,7 +2135,7 @@
1551A336158F2AB200E66CFE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0820;
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = "";
};
buildConfigurationList = 1551A339158F2AB200E66CFE /* Build configuration list for PBXProject "cocos2d_libs" */;

View File

@ -1680,85 +1680,6 @@ namespace
FLOAT
};
void toVec2(void* data, DataType type, se::Value* ret)
{
int32_t* intptr = (int32_t*)data;
float* floatptr = (float*)data;
cocos2d::Vec2 vec2;
if (DataType::INT == type)
{
vec2.x = *intptr;
vec2.y = *(intptr + 1);
}
else
{
vec2.x = *floatptr;
vec2.y = *(floatptr + 1);
}
Vec2_to_seval(vec2, ret);
}
void toVec3(void* data, DataType type, se::Value* ret)
{
int32_t* intptr = (int32_t*)data;
float* floatptr = (float*)data;
cocos2d::Vec3 vec3;
if (DataType::INT == type)
{
vec3.x = *intptr;
vec3.y = *(intptr + 1);
vec3.z = *(intptr + 2);
}
else
{
vec3.x = *floatptr;
vec3.y = *(floatptr + 1);
vec3.z = *(floatptr + 2);
}
Vec3_to_seval(vec3, ret);
}
void toVec4(void* data, DataType type, se::Value* ret)
{
int32_t* intptr = (int32_t*)data;
float* floatptr = (float*)data;
cocos2d::Vec4 vec4;
if (DataType::INT == type)
{
vec4.x = *intptr;
vec4.y = *(intptr + 1);
vec4.z = *(intptr + 2);
vec4.w = *(intptr + 3);
}
else
{
vec4.x = *floatptr;
vec4.y = *(floatptr + 1);
vec4.z = *(floatptr + 2);
vec4.w = *(floatptr + 3);
}
Vec4_to_seval(vec4, ret);
}
void toMat(float* data, int num, se::Value* ret)
{
se::HandleObject obj(se::Object::createPlainObject());
char propName[4] = {0};
for (int i = 0; i < num; ++i)
{
if (i < 10)
snprintf(propName, 3, "m0%d", i);
else
snprintf(propName, 3, "m%d", i);
obj->setProperty(propName, se::Value(*(data + i)));
}
ret->setObject(obj);
}
}
bool ManifestAsset_to_seval(const cocos2d::extension::ManifestAsset& v, se::Value* ret)