Scale the GUI to fit the screen
With this patch set, if needed, we scale the images during early
boot. TTF support is needed to properly scale the font. No font
scaling is done on the old style fixed width font used in the
console.
Special thanks to _that for figuring out the scaling and blending
function calls to make this possible.
Change-Id: If2f79bef16d6db2e1298bfc3d00c9bcca2bee37a
diff --git a/gui/resources.hpp b/gui/resources.hpp
index 603b1c9..cc5e7b6 100644
--- a/gui/resources.hpp
+++ b/gui/resources.hpp
@@ -25,6 +25,8 @@
protected:
static int ExtractResource(ZipArchive* pZip, std::string folderName, std::string fileName, std::string fileExtn, std::string destFile);
+ static void LoadImage(ZipArchive* pZip, std::string file, gr_surface* source);
+ static void CheckAndScaleImage(gr_surface source, gr_surface* destination, int retain_aspect);
};
class FontResource : public Resource
@@ -52,7 +54,7 @@
class ImageResource : public Resource
{
public:
- ImageResource(xml_node<>* node, ZipArchive* pZip);
+ ImageResource(xml_node<>* node, ZipArchive* pZip, int retain_aspect);
virtual ~ImageResource();
public:
@@ -65,7 +67,7 @@
class AnimationResource : public Resource
{
public:
- AnimationResource(xml_node<>* node, ZipArchive* pZip);
+ AnimationResource(xml_node<>* node, ZipArchive* pZip, int retain_aspect);
virtual ~AnimationResource();
public: