MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / DrawPolygonDecal

Method DrawPolygonDecal

olcPixelGameEngine.h:3598–3617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3596 }
3597
3598 void PixelGameEngine::DrawPolygonDecal(olc::Decal* decal, const std::vector<olc::vf2d>& pos, const std::vector<olc::vf2d>& uv, const olc::Pixel tint)
3599 {
3600 DecalInstance di;
3601 di.decal = decal;
3602 di.points = uint32_t(pos.size());
3603 di.pos.resize(di.points);
3604 di.uv.resize(di.points);
3605 di.w.resize(di.points);
3606 di.tint.resize(di.points);
3607 for (uint32_t i = 0; i < di.points; i++)
3608 {
3609 di.pos[i] = { (pos[i].x * vInvScreenSize.x) * 2.0f - 1.0f, ((pos[i].y * vInvScreenSize.y) * 2.0f - 1.0f) * -1.0f };
3610 di.uv[i] = uv[i];
3611 di.tint[i] = tint;
3612 di.w[i] = 1.0f;
3613 }
3614 di.mode = nDecalMode;
3615 di.structure = nDecalStructure;
3616 vLayers[nTargetLayer].vecDecalInstance.push_back(di);
3617 }
3618
3619 void PixelGameEngine::DrawPolygonDecal(olc::Decal* decal, const std::vector<olc::vf2d>& pos, const std::vector<olc::vf2d>& uv, const std::vector<olc::Pixel>& tint)
3620 {

Callers

nothing calls this directly

Calls 5

push_backMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected