|
|
|
@ -1144,7 +1144,7 @@ namespace olc |
|
|
|
|
// Draws a decal rotated to specified angle, wit point of rotation offset
|
|
|
|
|
void DrawRotatedDecal(const olc::vf2d& pos, olc::Decal* decal, const float fAngle, const olc::vf2d& center = { 0.0f, 0.0f }, const olc::vf2d& scale = { 1.0f,1.0f }, const olc::Pixel& tint = olc::WHITE); |
|
|
|
|
void DrawPartialRotatedDecal(const olc::vf2d& pos, olc::Decal* decal, const float fAngle, const olc::vf2d& center, const olc::vf2d& source_pos, const olc::vf2d& source_size, const olc::vf2d& scale = { 1.0f, 1.0f }, const olc::Pixel& tint = olc::WHITE); |
|
|
|
|
void DrawPartialSquishedRotatedDecal(const olc::vf2d& pos, olc::Decal* decal, const float fAngle, const olc::vf2d& center, const olc::vf2d& source_pos, const olc::vf2d& source_size, const olc::vf2d& scale = { 1.0f, 1.0f }, const olc::Pixel& tint = olc::WHITE); |
|
|
|
|
void DrawPartialSquishedRotatedDecal(const olc::vf2d& pos, olc::Decal* decal, const float fAngle, const olc::vf2d& center, const olc::vf2d& source_pos, const olc::vf2d& source_size, const olc::vf2d& scale = { 1.0f, 1.0f }, const olc::vf2d& squishScale = { 1.0f, 1.0f }, const olc::Pixel& tint = olc::WHITE); |
|
|
|
|
// Draws a multiline string as a decal, with tiniting and scaling
|
|
|
|
|
void DrawStringDecal(const olc::vf2d& pos, std::string_view sText, const Pixel col = olc::WHITE, const olc::vf2d& scale = { 1.0f, 1.0f },const float width=std::numeric_limits<float>::max(),const bool disableDynamicScaling=false); |
|
|
|
|
void DrawOGStringDecal(const olc::vf2d& pos, const std::string& sText, const Pixel col = olc::WHITE, const olc::vf2d& scale = { 1.0f, 1.0f }); |
|
|
|
@ -3322,7 +3322,7 @@ namespace olc |
|
|
|
|
di.structure = nDecalStructure; |
|
|
|
|
vLayers[nTargetLayer].vecDecalInstance.push_back(di); |
|
|
|
|
} |
|
|
|
|
void PixelGameEngine::DrawPartialSquishedRotatedDecal(const olc::vf2d& pos, olc::Decal* decal, const float fAngle, const olc::vf2d& center, const olc::vf2d& source_pos, const olc::vf2d& source_size, const olc::vf2d& scale, const olc::Pixel& tint) |
|
|
|
|
void PixelGameEngine::DrawPartialSquishedRotatedDecal(const olc::vf2d& pos, olc::Decal* decal, const float fAngle, const olc::vf2d& center, const olc::vf2d& source_pos, const olc::vf2d& source_size, const olc::vf2d& scale, const olc::vf2d& squishScale, const olc::Pixel& tint) |
|
|
|
|
{ |
|
|
|
|
DecalInstance di; |
|
|
|
|
di.decal = decal; |
|
|
|
@ -3330,10 +3330,10 @@ namespace olc |
|
|
|
|
di.tint = { tint, tint, tint, tint }; |
|
|
|
|
di.w = { 1, 1, 1, 1 }; |
|
|
|
|
di.pos.resize(4); |
|
|
|
|
di.pos[0] = (olc::vf2d(0.0f, 0.0f) - center); |
|
|
|
|
di.pos[1] = (olc::vf2d(0.0f, source_size.y) - center); |
|
|
|
|
di.pos[2] = (olc::vf2d(source_size.x, source_size.y) - center); |
|
|
|
|
di.pos[3] = (olc::vf2d(source_size.x, 0.0f) - center); |
|
|
|
|
di.pos[0] = (olc::vf2d(0.0f, 0.0f) - center)*scale; |
|
|
|
|
di.pos[1] = (olc::vf2d(0.0f, source_size.y) - center)*scale; |
|
|
|
|
di.pos[2] = (olc::vf2d(source_size.x, source_size.y) - center)*scale; |
|
|
|
|
di.pos[3] = (olc::vf2d(source_size.x, 0.0f) - center)*scale; |
|
|
|
|
float c = cos(fAngle), s = sin(fAngle); |
|
|
|
|
for (int i = 0; i < 4; i++) |
|
|
|
|
{ |
|
|
|
@ -3341,10 +3341,10 @@ namespace olc |
|
|
|
|
di.pos[i] = di.pos[i] * vInvScreenSize * 2.0f - olc::vf2d(1.0f, 1.0f); |
|
|
|
|
di.pos[i].y *= -1.0f; |
|
|
|
|
} |
|
|
|
|
di.pos[0] *= scale; |
|
|
|
|
di.pos[1] *= scale; |
|
|
|
|
di.pos[2] *= scale; |
|
|
|
|
di.pos[3] *= scale; |
|
|
|
|
di.pos[0] *= squishScale; |
|
|
|
|
di.pos[1] *= squishScale; |
|
|
|
|
di.pos[2] *= squishScale; |
|
|
|
|
di.pos[3] *= squishScale; |
|
|
|
|
|
|
|
|
|
olc::vf2d uvtl = source_pos * decal->vUVScale; |
|
|
|
|
olc::vf2d uvbr = uvtl + (source_size * decal->vUVScale); |
|
|
|
|