|
|
|
@ -1154,6 +1154,7 @@ namespace olc |
|
|
|
|
void ClearBuffer(Pixel p, bool bDepth = true); |
|
|
|
|
// Returns the font image
|
|
|
|
|
olc::Sprite* GetFontSprite(); |
|
|
|
|
void SetFontSprite(std::string_view newFontFile); |
|
|
|
|
|
|
|
|
|
// Clip a line segment to visible area
|
|
|
|
|
bool ClipLineToScreen(olc::vi2d& in_p1, olc::vi2d& in_p2); |
|
|
|
@ -2377,6 +2378,9 @@ namespace olc |
|
|
|
|
olc::Sprite* PixelGameEngine::GetFontSprite() |
|
|
|
|
{ return fontRenderable.Sprite(); } |
|
|
|
|
|
|
|
|
|
void PixelGameEngine::SetFontSprite(std::string_view newFontFile) |
|
|
|
|
{ fontRenderable.Load(std::string(newFontFile)); } |
|
|
|
|
|
|
|
|
|
bool PixelGameEngine::ClipLineToScreen(olc::vi2d& in_p1, olc::vi2d& in_p2) |
|
|
|
|
{ |
|
|
|
|
// https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm
|
|
|
|
@ -4071,8 +4075,8 @@ namespace olc |
|
|
|
|
0x08,0x17,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x24,0x15,0x06,0x07,0x16,0x17, |
|
|
|
|
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x17,0x08,0x08,0x17,0x08,0x08,0x08, |
|
|
|
|
0x08,0x08,0x08,0x08,0x17,0x08,0x08,0x08,0x08,0x17,0x08,0x15,0x08,0x15,0x08,0x08, |
|
|
|
|
0x24,0x18,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x33,0x17,0x17,0x33,0x18,0x17,0x17, |
|
|
|
|
0x17,0x17,0x17,0x17,0x07,0x17,0x17,0x18,0x18,0x17,0x17,0x07,0x33,0x07,0x08,0x00, } }; |
|
|
|
|
0x24,0x16,0x16,0x17,0x16,0x16,0x15,0x17,0x17,0x33,0x15,0x17,0x23,0x08,0x17,0x16, |
|
|
|
|
0x07,0x07,0x24,0x17,0x06,0x17,0x16,0x08,0x23,0x17,0x17,0x07,0x33,0x07,0x08,0x00, } }; |
|
|
|
|
|
|
|
|
|
for (auto c : vSpacing) vFontSpacing.push_back({ c >> 4, c & 15 }); |
|
|
|
|
|
|
|
|
|