loader/lottie: fix all data conversion compiler warnings on windows

This commit is contained in:
Hermet Park 2023-08-18 16:34:56 +09:00
parent c90962a26c
commit 664f028c15
2 changed files with 6 additions and 6 deletions

View file

@ -351,7 +351,7 @@ static void _updatePrecomp(LottieLayer* precomp, int32_t frameNo)
static void _updateSolid(LottieLayer* layer, int32_t frameNo)
{
auto shape = Shape::gen();
shape->appendRect(0, 0, layer->w, layer->h);
shape->appendRect(0, 0, static_cast<float>(layer->w), static_cast<float>(layer->h));
shape->fill(layer->color.rgb[0], layer->color.rgb[1], layer->color.rgb[2], layer->opacity(frameNo));
layer->scene->push(std::move(shape));
}

View file

@ -39,12 +39,12 @@ static bool _checkDotLottie(const char *str)
}
static int _str2float(const char* str, int len)
static float _str2float(const char* str, int len)
{
auto tmp = strDuplicate(str, len);
auto ret = strToFloat(tmp, nullptr);
free(tmp);
return lround(ret);
return ret;
}
@ -71,8 +71,8 @@ void LottieLoader::run(unsigned tid)
comp = parser.comp;
if (!comp) return;
builder->build(comp);
w = comp->w;
h = comp->h;
w = static_cast<float>(comp->w);
h = static_cast<float>(comp->h);
frameDuration = comp->duration();
}
}
@ -109,7 +109,7 @@ bool LottieLoader::header()
//Quickly validate the given Lottie file without parsing in order to get the animation info.
auto startFrame = 0.0f;
auto endFrame = 0.0f;
float frameRate = 0.0f;
auto frameRate = 0.0f;
uint32_t depth = 0;
auto p = content;