diff --git a/src/loaders/lottie/tvgLottieParser.cpp b/src/loaders/lottie/tvgLottieParser.cpp index 8478c1b6..11787bbf 100644 --- a/src/loaders/lottie/tvgLottieParser.cpp +++ b/src/loaders/lottie/tvgLottieParser.cpp @@ -252,7 +252,7 @@ void LottieParser::getValue(ColorStop& color) { if (peekType() == kArrayType) enterArray(); - color.input = new Array(context->gradient->colorStops.count); + color.input = new Array(context.gradient->colorStops.count); while (nextArrayValue()) color.input->push(getFloat()); } @@ -700,7 +700,7 @@ LottieRoundedCorner* LottieParser::parseRoundedCorner() void LottieParser::parseGradient(LottieGradient* gradient, const char* key) { - context->gradient = gradient; + context.gradient = gradient; if (!strcmp(key, "t")) gradient->id = getInt(); else if (!strcmp(key, "o")) parseProperty(gradient->opacity, gradient); @@ -1132,7 +1132,7 @@ LottieLayer* LottieParser::parseLayer() if (!layer) return nullptr; layer->comp = comp; - context->layer = layer; + context.layer = layer; auto ddd = false; @@ -1253,8 +1253,6 @@ bool LottieParser::parse(LottieSlot* slot) { enterObject(); - LottieParser::Context context; - this->context = &context; LottieObject* obj = nullptr; //slot object switch (slot->type) { @@ -1303,10 +1301,6 @@ bool LottieParser::parse() Array glyphes; - //assign parsing context - LottieParser::Context context; - this->context = &context; - while (auto key = nextObjectKey()) { if (!strcmp(key, "v")) comp->version = getStringCopy(); else if (!strcmp(key, "fr")) comp->frameRate = getFloat(); diff --git a/src/loaders/lottie/tvgLottieParser.h b/src/loaders/lottie/tvgLottieParser.h index 635a1c1d..49367f97 100644 --- a/src/loaders/lottie/tvgLottieParser.h +++ b/src/loaders/lottie/tvgLottieParser.h @@ -110,7 +110,7 @@ private: struct Context { LottieLayer* layer = nullptr; LottieGradient* gradient = nullptr; - } *context; + } context; }; #endif //_TVG_LOTTIE_PARSER_H_ \ No newline at end of file