From b8a967fb98273379e156ee6e284cdd3453a4fa8d Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Thu, 22 Aug 2024 20:03:02 +0200 Subject: [PATCH 1/4] Apply Guichan's changes from 112ad7b3be4a069c22a74e7904b109f825d7fa11 (Apr 30th 2008) Removed some unused variables. --- TODO | 2 +- src/imagefont.cpp | 4 ---- src/widgets/window.cpp | 6 ++---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index 468b408..b726b4e 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from 112ad7b3be4a069c22a74e7904b109f825d7fa11 +* Continue rebasing from c9cb0c91b00701da2666f1ab3e5269d79e46c55b * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX. diff --git a/src/imagefont.cpp b/src/imagefont.cpp index e57d011..f822196 100644 --- a/src/imagefont.cpp +++ b/src/imagefont.cpp @@ -110,8 +110,6 @@ namespace gcn y = mGlyph[k].y; } - //int w = mImage->getWidth(); - //int h = mImage->getHeight(); mImage->convertToDisplayFormat(); mRowSpacing = 0; @@ -205,8 +203,6 @@ namespace gcn y = mGlyph[i].y; } - //int w = mImage->getWidth(); - //int h = mImage->getHeight(); mImage->convertToDisplayFormat(); mRowSpacing = 0; diff --git a/src/widgets/window.cpp b/src/widgets/window.cpp index 34c24c8..ed8e44e 100644 --- a/src/widgets/window.cpp +++ b/src/widgets/window.cpp @@ -138,11 +138,9 @@ namespace gcn void Window::draw(Graphics* graphics) { - Color faceColor = getBaseColor(); + const Color& faceColor = getBaseColor(); Color highlightColor, shadowColor; - int alpha = getBaseColor().a; - //int width = getWidth() + getFrameSize() * 2 - 1; - //int height = getHeight() + getFrameSize() * 2 - 1; + const int alpha = getBaseColor().a; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; From 8a55ff27449ba113537d178819643e21a86f5b8b Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Thu, 22 Aug 2024 20:08:59 +0200 Subject: [PATCH 2/4] Apply Guichan's changes from 7797ca3ad0313d1c78288ec207d35f9f3d3e9076 (May 3rd 2008) A minor error in the main class documentation has been fixed. --- TODO | 2 +- include/guisan/imagefont.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index b726b4e..eef79b9 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from c9cb0c91b00701da2666f1ab3e5269d79e46c55b +* Continue rebasing from 6d13c76b517871e31c7741cf39403573ad85f318 * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX. diff --git a/include/guisan/imagefont.hpp b/include/guisan/imagefont.hpp index 962b8bd..d805be8 100644 --- a/include/guisan/imagefont.hpp +++ b/include/guisan/imagefont.hpp @@ -91,7 +91,7 @@ pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); @endcode * Note worthy is that the first glyph actually gives the width of space. * Glyphs can, as seen in the second image example above, be seperated with * horizontal lines making it possible to draw glyphs on more then one - * line in the image. However, these vertical lines must have a height of + * line in the image. However, these horizontal lines must have a height of * one pixel! */ class GCN_CORE_DECLSPEC ImageFont: public Font From 4bd3f77df6fc129653784e3ac932c33810c6ae1e Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Thu, 22 Aug 2024 20:15:45 +0200 Subject: [PATCH 3/4] Apply Guichan's changes from 6d13c76b517871e31c7741cf39403573ad85f318 (May 3rd 2008) API documentation has been enhanced. --- TODO | 2 +- include/guisan/imagefont.hpp | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index eef79b9..81d8c46 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from 6d13c76b517871e31c7741cf39403573ad85f318 +* Continue rebasing from d63ab261c53a2bfca85657148087bebe65c5c11b * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX. diff --git a/include/guisan/imagefont.hpp b/include/guisan/imagefont.hpp index d805be8..9d50745 100644 --- a/include/guisan/imagefont.hpp +++ b/include/guisan/imagefont.hpp @@ -71,17 +71,15 @@ namespace gcn /** * A font using an image containing the font data. ImageFont can be used - * with any supported by the current used ImageLoader. + * with any image supported by the current used ImageLoader. * * These are two examples of an image containing a font. * \image html imagefontexample.bmp * \image html imagefontexample2.bmp * - * The Image font format works like this: The first pixel, the pixal at - * coordinate (0,0), tells which color to look for when seperating glyphs. - * You create an image with your glyphs and simple separates them with - * the seperation color. When you create your image font you supply the - * constructor with the glyphs present in your image. + * The first pixel at coordinate (0,0) tells which color the image font + * looks for when seperating glyphs. The glyphs in the image is provided + * to the image font's constructor in the order they appear in the image. * * To create an ImageFont from the first image example above the following * constructor call should be made: From dbb3a5b608a49c459eb2cc3b8155c5ab9533f806 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Thu, 22 Aug 2024 20:20:59 +0200 Subject: [PATCH 4/4] Apply Guichan's changes from d63ab261c53a2bfca85657148087bebe65c5c11b (May 4th 2008) Fixed two spelling errors and some whitespace corrections (tab removal). Also added some casts where my compiler was warning. --- TODO | 2 +- include/guisan/imagefont.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 81d8c46..36fa7ff 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from d63ab261c53a2bfca85657148087bebe65c5c11b +* Continue rebasing from a154429864dc2a948d29f21cdcdf688177bb54a8 * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX. diff --git a/include/guisan/imagefont.hpp b/include/guisan/imagefont.hpp index 9d50745..03ac147 100644 --- a/include/guisan/imagefont.hpp +++ b/include/guisan/imagefont.hpp @@ -71,7 +71,7 @@ namespace gcn /** * A font using an image containing the font data. ImageFont can be used - * with any image supported by the current used ImageLoader. + * with any image supported by the currently used ImageLoader. * * These are two examples of an image containing a font. * \image html imagefontexample.bmp @@ -86,7 +86,7 @@ namespace gcn * @code gcn::ImageFont imageFont("fixedfont_big.bmp"," abcdefghijklmno\ pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); @endcode * - * Note worthy is that the first glyph actually gives the width of space. + * Noteworthy is that the first glyph actually gives the width of space. * Glyphs can, as seen in the second image example above, be seperated with * horizontal lines making it possible to draw glyphs on more then one * line in the image. However, these horizontal lines must have a height of