Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/io/collada/GeometryExporter.cpp')
-rw-r--r--source/blender/io/collada/GeometryExporter.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/io/collada/GeometryExporter.cpp b/source/blender/io/collada/GeometryExporter.cpp
index e60900ccdb6..f6f9026481c 100644
--- a/source/blender/io/collada/GeometryExporter.cpp
+++ b/source/blender/io/collada/GeometryExporter.cpp
@@ -64,7 +64,7 @@ void GeometryExporter::operator()(Object *ob)
exportedGeometry.insert(geom_id);
- bool has_color = (bool)CustomData_has_layer(&me->fdata, CD_MCOL);
+ bool has_color = bool(CustomData_has_layer(&me->fdata, CD_MCOL));
create_normals(nor, norind, me);
@@ -77,7 +77,7 @@ void GeometryExporter::operator()(Object *ob)
/* writes <source> for normal coords */
createNormalsSource(geom_id, me, nor);
- bool has_uvs = (bool)CustomData_has_layer(&me->ldata, CD_MLOOPUV);
+ bool has_uvs = bool(CustomData_has_layer(&me->ldata, CD_MLOOPUV));
/* writes <source> for uv coords if mesh has uv coords */
if (has_uvs) {
@@ -147,7 +147,7 @@ void GeometryExporter::export_key_mesh(Object *ob, Mesh *me, KeyBlock *kb)
exportedGeometry.insert(geom_id);
- bool has_color = (bool)CustomData_has_layer(&me->fdata, CD_MCOL);
+ bool has_color = bool(CustomData_has_layer(&me->fdata, CD_MCOL));
create_normals(nor, norind, me);
@@ -160,7 +160,7 @@ void GeometryExporter::export_key_mesh(Object *ob, Mesh *me, KeyBlock *kb)
/* writes <source> for normal coords */
createNormalsSource(geom_id, me, nor);
- bool has_uvs = (bool)CustomData_has_layer(&me->ldata, CD_MLOOPUV);
+ bool has_uvs = bool(CustomData_has_layer(&me->ldata, CD_MLOOPUV));
/* writes <source> for uv coords if mesh has uv coords */
if (has_uvs) {
@@ -203,7 +203,7 @@ void GeometryExporter::createLooseEdgeList(Object *ob, Mesh *me, std::string &ge
const Span<MEdge> edges = me->edges();
int totedges = me->totedge;
int edges_in_linelist = 0;
- std::vector<unsigned int> edge_list;
+ std::vector<uint> edge_list;
int index;
/* Find all loose edges in Mesh
@@ -244,7 +244,7 @@ void GeometryExporter::createLooseEdgeList(Object *ob, Mesh *me, std::string &ge
static void prepareToAppendValues(bool is_triangulated,
COLLADASW::PrimitivesBase &primitive_list,
- std::vector<unsigned long> &vcount_list)
+ std::vector<ulong> &vcount_list)
{
/* performs the actual writing */
if (is_triangulated) {
@@ -285,7 +285,7 @@ static COLLADASW::PrimitivesBase *create_primitive_list(bool is_triangulated,
static bool collect_vertex_counts_per_poly(Mesh *me,
int material_index,
- std::vector<unsigned long> &vcount_list)
+ std::vector<ulong> &vcount_list)
{
const Span<MPoly> polys = me->polys();
const blender::bke::AttributeAccessor attributes = me->attributes();
@@ -325,7 +325,7 @@ void GeometryExporter::create_mesh_primitive_list(short material_index,
const Span<MPoly> polys = me->polys();
const Span<MLoop> loops = me->loops();
- std::vector<unsigned long> vcount_list;
+ std::vector<ulong> vcount_list;
bool is_triangulated = collect_vertex_counts_per_poly(me, material_index, vcount_list);
int polygon_count = vcount_list.size();
@@ -522,7 +522,7 @@ std::string GeometryExporter::makeTexcoordSourceId(std::string &geom_id,
suffix[0] = '\0';
}
else {
- sprintf(suffix, "-%d", layer_index);
+ BLI_snprintf(suffix, sizeof(suffix), "-%d", layer_index);
}
return getIdBySemantics(geom_id, COLLADASW::InputSemantic::TEXCOORD) + suffix;
}
@@ -585,7 +585,7 @@ void GeometryExporter::createNormalsSource(std::string geom_id, Mesh *me, std::v
COLLADASW::FloatSourceF source(mSW);
source.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::NORMAL));
source.setArrayId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::NORMAL) + ARRAY_ID_SUFFIX);
- source.setAccessorCount((unsigned long)nor.size());
+ source.setAccessorCount(ulong(nor.size()));
source.setAccessorStride(3);
COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
param.push_back("X");
@@ -612,7 +612,7 @@ void GeometryExporter::create_normals(std::vector<Normal> &normals,
std::vector<BCPolygonNormalsIndices> &polygons_normals,
Mesh *me)
{
- std::map<Normal, unsigned int> shared_normal_indices;
+ std::map<Normal, uint> shared_normal_indices;
int last_normal_index = -1;
const Span<MVert> verts = me->verts();
@@ -645,7 +645,7 @@ void GeometryExporter::create_normals(std::vector<Normal> &normals,
BCPolygonNormalsIndices poly_indices;
for (int loop_index = 0; loop_index < mpoly->totloop; loop_index++) {
- unsigned int loop_idx = mpoly->loopstart + loop_index;
+ uint loop_idx = mpoly->loopstart + loop_index;
if (use_vertex_normals) {
float normalized[3];