From 63e414fc8a7ec04a0710a05ac9ce610fbb15f1e5 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Fri, 6 Feb 2015 15:44:39 -0600 Subject: 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 --- gui/resources.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gui/resources.hpp') diff --git a/gui/resources.hpp b/gui/resources.hpp index 603b1c958..cc5e7b6ff 100644 --- a/gui/resources.hpp +++ b/gui/resources.hpp @@ -25,6 +25,8 @@ private: 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 @@ protected: 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 @@ protected: class AnimationResource : public Resource { public: - AnimationResource(xml_node<>* node, ZipArchive* pZip); + AnimationResource(xml_node<>* node, ZipArchive* pZip, int retain_aspect); virtual ~AnimationResource(); public: -- cgit v1.2.3