Fix rule handling to help the end user get things right.

Tidied up anti-alias where the hardware does not support pixel read-back.
ugfx_release_2.6
inmarket 2013-07-29 16:31:54 +10:00
parent 7c303eb72e
commit 7f15192fe8
3 changed files with 46 additions and 2 deletions

View File

@ -139,13 +139,35 @@
#endif
#if GDISP_NEED_ASYNC && !(GFX_USE_GQUEUE && GQUEUE_NEED_GSYNC)
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GDISP: GFX_USE_GQUEUE or GQUEUE_NEED_GSYNC is not TRUE. It has been turned on for you."
#warning "GDISP: GDISP_NEED_ASYNC requires GFX_USE_GQUEUE and GQUEUE_NEED_GSYNC. They have been turned on for you."
#endif
#undef GFX_USE_GQUEUE
#define GFX_USE_GQUEUE TRUE
#undef GQUEUE_NEED_GSYNC
#define GQUEUE_NEED_GSYNC TRUE
#endif
#if GDISP_NEED_ANTIALIAS && !GDISP_NEED_PIXELREAD
#if GDISP_HARDWARE_PIXELREAD
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GDISP: GDISP_NEED_ANTIALIAS has been set but GDISP_NEED_PIXELREAD has not. It has been turned on for you."
#endif
#undef GDISP_NEED_PIXELREAD
#define GDISP_NEED_PIXELREAD TRUE
#else
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GDISP: GDISP_NEED_ANTIALIAS has been set but your hardware does not support reading back pixels. Anti-aliasing will only occur for filled characters."
#endif
#endif
#endif
#if (defined(GDISP_INCLUDE_FONT_SMALL) && GDISP_INCLUDE_FONT_SMALL) || (defined(GDISP_INCLUDE_FONT_LARGER) && GDISP_INCLUDE_FONT_LARGER) \
|| (defined(GDISP_INCLUDE_FONT_UI1) && GDISP_INCLUDE_FONT_UI1) || (defined(GDISP_INCLUDE_FONT_UI2) && GDISP_INCLUDE_FONT_UI2)
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GDISP: An old font (Small, Larger, UI1, UI2) has been defined. A single default font of DEJAVUSANS12 has been added instead."
#warning "GDISP: Please see <$(GFXLIB)/include/gdisp/fonts/fonts.h> for a list of available font names."
#endif
#undef GDISP_INCLUDE_FONT_DEJAVUSANS12
#define GDISP_INCLUDE_FONT_DEJAVUSANS12 TRUE
#endif
#endif
#if GFX_USE_TDISP

View File

@ -71,7 +71,10 @@ for file in *.c; do
upper=${noext^^}
defname='GDISP_INCLUDE_FONT_'$upper
echo '#if defined('$defname') && '$defname >> fonts.h
echo '#define GDISP_FONT_FOUND' >> fonts.h
echo '#include "'$file'"' >> fonts.h
echo '#endif' >> fonts.h
done
echo '#ifndef GDISP_FONT_FOUND' >> fonts.h
echo '#error "GDISP: No fonts have been included"' >> fonts.h
echo '#endif' >> fonts.h

View File

@ -2,61 +2,80 @@
#include <gfx.h>
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS10) && GDISP_INCLUDE_FONT_DEJAVUSANS10
#define GDISP_FONT_FOUND
#include "DejaVuSans10.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS12_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS12_AA
#define GDISP_FONT_FOUND
#include "DejaVuSans12_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS12) && GDISP_INCLUDE_FONT_DEJAVUSANS12
#define GDISP_FONT_FOUND
#include "DejaVuSans12.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS16_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS16_AA
#define GDISP_FONT_FOUND
#include "DejaVuSans16_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS16) && GDISP_INCLUDE_FONT_DEJAVUSANS16
#define GDISP_FONT_FOUND
#include "DejaVuSans16.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS24_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS24_AA
#define GDISP_FONT_FOUND
#include "DejaVuSans24_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS24) && GDISP_INCLUDE_FONT_DEJAVUSANS24
#define GDISP_FONT_FOUND
#include "DejaVuSans24.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS32_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS32_AA
#define GDISP_FONT_FOUND
#include "DejaVuSans32_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS32) && GDISP_INCLUDE_FONT_DEJAVUSANS32
#define GDISP_FONT_FOUND
#include "DejaVuSans32.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA) && GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA
#define GDISP_FONT_FOUND
#include "DejaVuSansBold12_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12) && GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12
#define GDISP_FONT_FOUND
#include "DejaVuSansBold12.c"
#endif
#if defined(GDISP_INCLUDE_FONT_FIXED_10X20) && GDISP_INCLUDE_FONT_FIXED_10X20
#define GDISP_FONT_FOUND
#include "fixed_10x20.c"
#endif
#if defined(GDISP_INCLUDE_FONT_FIXED_5X8) && GDISP_INCLUDE_FONT_FIXED_5X8
#define GDISP_FONT_FOUND
#include "fixed_5x8.c"
#endif
#if defined(GDISP_INCLUDE_FONT_FIXED_7X14) && GDISP_INCLUDE_FONT_FIXED_7X14
#define GDISP_FONT_FOUND
#include "fixed_7x14.c"
#endif
#if defined(GDISP_INCLUDE_FONT_LARGENUMBERS) && GDISP_INCLUDE_FONT_LARGENUMBERS
#define GDISP_FONT_FOUND
#include "LargeNumbers.c"
#endif
#ifndef GDISP_FONT_FOUND
#error "GDISP: No fonts have been included"
#endif