| 3575 | } |
| 3576 | |
| 3577 | void PixelGameEngine::DrawExplicitDecal(olc::Decal* decal, const olc::vf2d* pos, const olc::vf2d* uv, const olc::Pixel* col, uint32_t elements) |
| 3578 | { |
| 3579 | DecalInstance di; |
| 3580 | di.decal = decal; |
| 3581 | di.pos.resize(elements); |
| 3582 | di.uv.resize(elements); |
| 3583 | di.w.resize(elements); |
| 3584 | di.tint.resize(elements); |
| 3585 | di.points = elements; |
| 3586 | for (uint32_t i = 0; i < elements; i++) |
| 3587 | { |
| 3588 | di.pos[i] = { (pos[i].x * vInvScreenSize.x) * 2.0f - 1.0f, ((pos[i].y * vInvScreenSize.y) * 2.0f - 1.0f) * -1.0f }; |
| 3589 | di.uv[i] = uv[i]; |
| 3590 | di.tint[i] = col[i]; |
| 3591 | di.w[i] = 1.0f; |
| 3592 | } |
| 3593 | di.mode = nDecalMode; |
| 3594 | di.structure = nDecalStructure; |
| 3595 | vLayers[nTargetLayer].vecDecalInstance.push_back(di); |
| 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 | { |