Skip to content

Commit

Permalink
Traktor: Fixed bitmap ID in SVG Spark importer.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Mar 10, 2024
1 parent 5cc2471 commit 8089d42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions code/Spark/Editor/ConvertSvg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Ref< Movie > convertSvg(const traktor::Path& assetPath, const MovieAsset* movieA
};
AlignedVector< SD > spriteStack;
uint32_t characterId = 1;
uint16_t fillBitmapId = 1;

ShapeVisitor createCharactersVisitor(
[&](svg::Shape* svg) -> bool
Expand Down Expand Up @@ -282,13 +283,11 @@ Ref< Movie > convertSvg(const traktor::Path& assetPath, const MovieAsset* movieA
pnt = moviePnt;
}

const uint16_t fillBitmap = 1;

movie->defineBitmap(fillBitmap, new BitmapImage(image));
movie->defineBitmap(fillBitmapId, new BitmapImage(image));

const float sx = (pnts[1].x - pnts[0].x) / width;
const float sy = (pnts[1].y - pnts[0].y) / height;
const uint16_t fillStyle = spriteStack.back().shape->defineFillStyle(fillBitmap, Matrix33(
const uint16_t fillStyle = spriteStack.back().shape->defineFillStyle(fillBitmapId, Matrix33(
sx * 20.0f, 0.0f, pnts[0].x,
0.0f, sy * 20.0f, pnts[0].y,
0.0f, 0.0f, 1.0f
Expand All @@ -303,6 +302,8 @@ Ref< Movie > convertSvg(const traktor::Path& assetPath, const MovieAsset* movieA
path.end(fillStyle, fillStyle, 0);

spriteStack.back().shape->addPath(path);

++fillBitmapId;
}
else if (const auto ts = dynamic_type_cast< const svg::TextShape* >(svg))
{
Expand Down
4 changes: 2 additions & 2 deletions code/Spark/Editor/Pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct AtlasBucket

}

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.spark.Pipeline", 11, Pipeline, editor::IPipeline)
T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.spark.Pipeline", 13, Pipeline, editor::IPipeline)

Pipeline::Pipeline()
: m_generateMips(false)
Expand All @@ -78,7 +78,7 @@ bool Pipeline::create(const editor::IPipelineSettings* settings)
m_assetPath = settings->getPropertyExcludeHash< std::wstring >(L"Pipeline.AssetPath", L"");
m_generateMips = settings->getPropertyIncludeHash< bool >(L"Pipeline.GenerateMips", false);
m_sharpenStrength = settings->getPropertyIncludeHash< bool >(L"Pipeline.SharpenStrength", false);
m_useTextureCompression = settings->getPropertyIncludeHash< bool >(L"Pipeline.UseTextureCompression", true);
m_useTextureCompression = settings->getPropertyIncludeHash< bool >(L"Pipeline.UseTextureCompression", false);
m_textureSizeDenom = settings->getPropertyIncludeHash< int32_t >(L"Pipeline.TextureSizeDenom", 1);
m_textureAtlasSize = settings->getPropertyIncludeHash< int32_t >(L"Pipeline.TextureAtlasSize", 1024);
return true;
Expand Down

0 comments on commit 8089d42

Please sign in to comment.