/* Internal Class Implementation */
/************************************************************************/
-enum class LoaderResult { InvalidType, Success, SizeCorruption, MemoryCorruption, LogicalCorruption };
+enum class LoaderResult { Success = 0, InvalidType, SizeCorruption, MemoryCorruption, LogicalCorruption };
static LoaderResult _parsePaint(tvgBlock block, Paint ** paint);
_read_tvg_ui16(&metaLen, *ptr);
*ptr += 2;
-
-//Meta data... Necessary?
-#ifdef THORVG_LOG_ENABLED
- char metadata[metaLen + 1];
- memcpy(metadata, *ptr, metaLen);
- metadata[metaLen] = '\0';
- printf("TVG_LOADER: Header is valid, metadata[%d]: %s.\n", metaLen, metadata);
-#endif
+ //Meta data... Need to replace checksum way.
+ //char metadata[metaLen + 1];
+ //memcpy(metadata, *ptr, metaLen);
+ //metadata[metaLen] = '\0';
*ptr += metaLen;
auto result = _parseSceneProperty(block, s.get());
if (result == LoaderResult::InvalidType) result = _parsePaintProperty(block, s.get());
+ if (result > LoaderResult::Success) return result;
- if (result > LoaderResult::Success) {
-#ifdef THORVG_LOG_ENABLED
- printf("TVG_LOADER: Loading scene error[type: 0x%02x]: %d\n", (int) block.type, (int) result);
-#endif
- return result;
- }
ptr = block.end;
}
*paint = s.release();
auto result = _parseShapeProperty(block, s.get());
if (result == LoaderResult::InvalidType) result = _parsePaintProperty(block, s.get());
-
- if (result > LoaderResult::Success) {
-#ifdef THORVG_LOG_ENABLED
- printf("TVG_LOADER: Loading shape error[type: 0x%02x]: %d\n", (int) block.type, (int) result);
-#endif
- return result;
- }
+ if (result > LoaderResult::Success) return result;
ptr = block.end;
}
*paint = s.release();
auto result = _parsePicture(block, s.get());
if (result == LoaderResult::InvalidType) result = _parsePaintProperty(block, s.get());
-
- if (result > LoaderResult::Success) {
-#ifdef THORVG_LOG_ENABLED
- printf("TVG_LOADER: Loading picture error[type: 0x%02x]: %d\n", (int) block.type, (int) result);
-#endif
- return result;
- }
+ if (result > LoaderResult::Success) return result;
ptr = block.end;
}
*paint = s.release();