Tie PGE font setting to resource pack loading system. Release Build 8168.

mac-build
sigonasr2 9 months ago
parent 90a20d77af
commit 73268374df
  1. 3
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 2
      Adventures in Lestoria/Version.h
  3. BIN
      Adventures in Lestoria/assets/gamepack.pak
  4. 15
      Adventures in Lestoria/olcPixelGameEngine.h
  5. BIN
      x64/Release/Adventures in Lestoria.exe

@ -3148,7 +3148,8 @@ void AiL::InitializeGraphics(){
}
std::cout<<VisualNovel::graphicsToLoad.size()<<" images for visual novel engine have been loaded."<<std::endl;
SetFontSprite("GFX_Prefix"_S+"font.png");
SetFontSprite("GFX_Prefix"_S+"font.png",&gamepack,"GENERATE_GAMEPACK"_B);
std::cout<<"Custom font loaded."<<std::endl;
Menu::themes.SetInitialized();
std::cout<<Menu::themes.size()<<" themes have been loaded."<<std::endl;

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 1
#define VERSION_BUILD 8165
#define VERSION_BUILD 8168
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -1223,7 +1223,7 @@ namespace olc
olc::Sprite* GetFontSprite();
// Returns the font image
olc::Decal* GetFontDecal();
void SetFontSprite(std::string_view filename);
void SetFontSprite(std::string_view filename,ResourcePack*pack,bool generateGamePack);
// Clip a line segment to visible area
bool ClipLineToScreen(olc::vi2d& in_p1, olc::vi2d& in_p2);
@ -2593,8 +2593,17 @@ namespace olc
{ return fontRenderable.Sprite(); }
olc::Decal* PixelGameEngine::GetFontDecal()
{ return fontRenderable.Decal(); }
void PixelGameEngine::SetFontSprite(std::string_view filename)
{ fontRenderable.Load(std::string(filename)); }
void PixelGameEngine::SetFontSprite(std::string_view filename,ResourcePack*pack,bool generateGamePack)
{
if(pack->Loaded()){
fontRenderable.Load(std::string(filename),pack);
}else{
fontRenderable.Load(std::string(filename),nullptr);
if(generateGamePack){
pack->AddFile(std::string(filename));
}
}
}
bool PixelGameEngine::ClipLineToScreen(olc::vi2d& in_p1, olc::vi2d& in_p2)
{

Loading…
Cancel
Save