From 9414d7a6e287ff8abfb5746b564e92c8f0e6de58 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sun, 24 Apr 2011 11:34:27 +0300 Subject: JANITORIAL: Reduce header dependencies in shared code Some backends may break as I only compiled SDL --- graphics/VectorRenderer.cpp | 7 +------ graphics/VectorRenderer.h | 7 +++++-- graphics/VectorRendererSpec.cpp | 1 - graphics/conversion.cpp | 1 + graphics/conversion.h | 3 ++- graphics/font.cpp | 4 ++++ graphics/font.h | 5 +++-- graphics/fontman.cpp | 1 + graphics/fontman.h | 3 ++- graphics/fonts/scummfont.cpp | 1 + graphics/fonts/winfont.cpp | 3 +++ graphics/fonts/winfont.h | 2 +- graphics/iff.cpp | 4 ++++ graphics/iff.h | 2 +- graphics/imagedec.cpp | 1 + graphics/imagedec.h | 3 +-- graphics/jpeg.cpp | 3 ++- graphics/palette.h | 1 + graphics/pict.cpp | 5 ++++- graphics/png.cpp | 3 ++- graphics/png.h | 7 +++++-- graphics/scaler/scale2x.cpp | 1 - graphics/scaler/scale3x.cpp | 1 - graphics/scaler/scalebit.cpp | 1 - graphics/scaler/thumbnail_intern.cpp | 1 + graphics/sjis.cpp | 1 + graphics/surface.cpp | 3 ++- graphics/surface.h | 5 ++++- graphics/thumbnail.cpp | 1 + graphics/wincursor.cpp | 5 +---- 30 files changed, 55 insertions(+), 31 deletions(-) (limited to 'graphics') diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index 0237712f13..e3ca0bf588 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -23,14 +23,9 @@ * */ +#include "common/textconsole.h" #include "common/util.h" -#include "common/system.h" -#include "common/events.h" -#include "graphics/surface.h" -#include "graphics/colormasks.h" - -#include "gui/ThemeEngine.h" #include "graphics/VectorRenderer.h" #define VECTOR_RENDERER_FAST_TRIANGLES diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index 0a783a077d..9285fa21c5 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -26,16 +26,19 @@ #ifndef VECTOR_RENDERER_H #define VECTOR_RENDERER_H +#include "common/rect.h" #include "common/scummsys.h" -#include "common/system.h" +#include "common/str.h" #include "graphics/surface.h" -#include "graphics/pixelformat.h" #include "gui/ThemeEngine.h" +class OSystem; + namespace Graphics { class VectorRenderer; +struct DrawStep; typedef void (VectorRenderer::*DrawingFunctionCallback)(const Common::Rect &, const Graphics::DrawStep &); diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 0ee13033af..3eef1b11a9 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -25,7 +25,6 @@ #include "common/util.h" #include "common/system.h" -#include "common/events.h" #include "common/frac.h" #include "graphics/surface.h" diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp index fee4b05f66..c9679432fa 100644 --- a/graphics/conversion.cpp +++ b/graphics/conversion.cpp @@ -23,6 +23,7 @@ */ #include "graphics/conversion.h" +#include "graphics/pixelformat.h" namespace Graphics { diff --git a/graphics/conversion.h b/graphics/conversion.h index b6d230612e..2759f3bb5e 100644 --- a/graphics/conversion.h +++ b/graphics/conversion.h @@ -27,10 +27,11 @@ #define GRAPHICS_CONVERSION_H #include "common/util.h" -#include "graphics/pixelformat.h" namespace Graphics { +struct PixelFormat; + /** Converting a color from YUV to RGB colorspace. */ inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) { r = CLIP(y + ((1357 * (v - 128)) >> 10), 0, 255); diff --git a/graphics/font.cpp b/graphics/font.cpp index 359374436c..9d450e881c 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -25,7 +25,11 @@ #include "common/stream.h" #include "common/file.h" #include "common/endian.h" +#include "common/array.h" +#include "common/textconsole.h" +#include "common/util.h" #include "graphics/font.h" +#include "graphics/surface.h" namespace Graphics { diff --git a/graphics/font.h b/graphics/font.h index b1a4735249..9e6e180ec3 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -26,15 +26,16 @@ #define GRAPHICS_FONT_H #include "common/str.h" -#include "common/array.h" -#include "graphics/surface.h" namespace Common { class SeekableReadStream; +template class Array; } namespace Graphics { +struct Surface; + /** Text alignment modes */ enum TextAlign { kTextAlignInvalid, diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp index 35ea14b199..bbd75bfca2 100644 --- a/graphics/fontman.cpp +++ b/graphics/fontman.cpp @@ -22,6 +22,7 @@ * $Id$ */ +#include "graphics/font.h" #include "graphics/fontman.h" DECLARE_SINGLETON(Graphics::FontManager); diff --git a/graphics/fontman.h b/graphics/fontman.h index 7871f32ba9..34b457ae83 100644 --- a/graphics/fontman.h +++ b/graphics/fontman.h @@ -30,11 +30,12 @@ #include "common/str.h" #include "common/hashmap.h" #include "common/hash-str.h" -#include "graphics/font.h" namespace Graphics { +class Font; + class FontManager : public Common::Singleton { public: enum FontUsage { diff --git a/graphics/fonts/scummfont.cpp b/graphics/fonts/scummfont.cpp index 87078e1475..ea1935cea5 100644 --- a/graphics/fonts/scummfont.cpp +++ b/graphics/fonts/scummfont.cpp @@ -23,6 +23,7 @@ */ #include "graphics/font.h" +#include "graphics/surface.h" namespace Graphics { diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp index 12509fd9e1..18866b4f6f 100644 --- a/graphics/fonts/winfont.cpp +++ b/graphics/fonts/winfont.cpp @@ -24,8 +24,11 @@ #include "common/file.h" #include "common/str.h" +#include "common/stream.h" +#include "common/textconsole.h" #include "common/winexe_ne.h" #include "common/winexe_pe.h" +#include "graphics/surface.h" #include "graphics/fonts/winfont.h" namespace Graphics { diff --git a/graphics/fonts/winfont.h b/graphics/fonts/winfont.h index a552b18b66..c31d45e2ce 100644 --- a/graphics/fonts/winfont.h +++ b/graphics/fonts/winfont.h @@ -25,11 +25,11 @@ #ifndef GRAPHICS_WINFONT_H #define GRAPHICS_WINFONT_H +#include "common/str.h" #include "graphics/font.h" namespace Common { class SeekableReadStream; -class String; } namespace Graphics { diff --git a/graphics/iff.cpp b/graphics/iff.cpp index 2174291112..a1f4e8aa6a 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -25,6 +25,10 @@ #include "graphics/iff.h" #include "graphics/surface.h" +#include "common/endian.h" +#include "common/func.h" +#include "common/iff_container.h" +#include "common/textconsole.h" #include "common/util.h" namespace Graphics { diff --git a/graphics/iff.h b/graphics/iff.h index 0aab0e09cb..fc837a3ea2 100644 --- a/graphics/iff.h +++ b/graphics/iff.h @@ -31,7 +31,7 @@ #ifndef GRAPHICS_IFF_H #define GRAPHICS_IFF_H -#include "common/iff_container.h" +#include "common/stream.h" namespace Graphics { diff --git a/graphics/imagedec.cpp b/graphics/imagedec.cpp index a4d2fbc1cf..91da83cc63 100644 --- a/graphics/imagedec.cpp +++ b/graphics/imagedec.cpp @@ -23,6 +23,7 @@ */ #include "graphics/imagedec.h" +#include "graphics/pixelformat.h" #include "graphics/surface.h" #include "common/file.h" diff --git a/graphics/imagedec.h b/graphics/imagedec.h index 13aa63a153..7ea987b1e4 100644 --- a/graphics/imagedec.h +++ b/graphics/imagedec.h @@ -28,14 +28,13 @@ #include "common/scummsys.h" #include "common/str.h" -#include "graphics/pixelformat.h" - namespace Common{ class SeekableReadStream; } namespace Graphics { +struct PixelFormat; struct Surface; class ImageDecoder { diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp index 169c3b5f1b..2d990b9b0e 100644 --- a/graphics/jpeg.cpp +++ b/graphics/jpeg.cpp @@ -27,9 +27,10 @@ #include "graphics/jpeg.h" #include "graphics/pixelformat.h" +#include "common/debug.h" #include "common/endian.h" -#include "common/util.h" #include "common/stream.h" +#include "common/textconsole.h" namespace Graphics { diff --git a/graphics/palette.h b/graphics/palette.h index 8d7fdbd99a..14e433f153 100644 --- a/graphics/palette.h +++ b/graphics/palette.h @@ -26,6 +26,7 @@ #ifndef GRAPHICS_PALETTE_H #define GRAPHICS_PALETTE_H +#include "common/scummsys.h" #include "common/noncopyable.h" /** diff --git a/graphics/pict.cpp b/graphics/pict.cpp index ca4aac751d..b61b000acd 100644 --- a/graphics/pict.cpp +++ b/graphics/pict.cpp @@ -23,9 +23,12 @@ * */ +#include "common/debug.h" +#include "common/endian.h" +#include "common/stream.h" #include "common/substream.h" +#include "common/textconsole.h" -#include "graphics/conversion.h" #include "graphics/jpeg.h" #include "graphics/pict.h" #include "graphics/surface.h" diff --git a/graphics/png.cpp b/graphics/png.cpp index ed1dd78674..46e3c2523b 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -23,13 +23,14 @@ * */ -#include "graphics/conversion.h" #include "graphics/png.h" #include "graphics/pixelformat.h" +#include "graphics/surface.h" #include "common/endian.h" #include "common/memstream.h" #include "common/stream.h" +#include "common/types.h" #include "common/util.h" #include "common/zlib.h" diff --git a/graphics/png.h b/graphics/png.h index af6630c9c4..21e0f35be1 100644 --- a/graphics/png.h +++ b/graphics/png.h @@ -31,8 +31,6 @@ #ifndef GRAPHICS_PNG_H #define GRAPHICS_PNG_H -#include "graphics/surface.h" - // PNG decoder, based on the W3C specs: // http://www.w3.org/TR/PNG/ // Parts of the code have been adapted from LodePNG, by Lode Vandevenne: @@ -54,12 +52,17 @@ // is a bit unclear. For now, these won't be supported, until a suitable sample // is found. +#include "common/scummsys.h" +#include "common/textconsole.h" + namespace Common { class SeekableReadStream; } namespace Graphics { +struct Surface; + enum PNGColorType { kGrayScale = 0, // bit depths: 1, 2, 4, 8, 16 kTrueColor = 2, // bit depths: 8, 16 diff --git a/graphics/scaler/scale2x.cpp b/graphics/scaler/scale2x.cpp index deae44c1c7..ec2aa2086e 100644 --- a/graphics/scaler/scale2x.cpp +++ b/graphics/scaler/scale2x.cpp @@ -34,7 +34,6 @@ #include "common/scummsys.h" -#include "graphics/scaler/intern.h" #include "graphics/scaler/scale2x.h" /***************************************************************************/ diff --git a/graphics/scaler/scale3x.cpp b/graphics/scaler/scale3x.cpp index 4e78796ee7..788c8694c5 100644 --- a/graphics/scaler/scale3x.cpp +++ b/graphics/scaler/scale3x.cpp @@ -34,7 +34,6 @@ #include "common/scummsys.h" -#include "graphics/scaler/intern.h" #include "graphics/scaler/scale3x.h" /***************************************************************************/ diff --git a/graphics/scaler/scalebit.cpp b/graphics/scaler/scalebit.cpp index 706fea8f05..c6d2a0d752 100644 --- a/graphics/scaler/scalebit.cpp +++ b/graphics/scaler/scalebit.cpp @@ -35,7 +35,6 @@ #include "common/scummsys.h" -#include "graphics/scaler/intern.h" #include "graphics/scaler/scale2x.h" #include "graphics/scaler/scale3x.h" diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp index 5cee1c7a72..4b460b29ce 100644 --- a/graphics/scaler/thumbnail_intern.cpp +++ b/graphics/scaler/thumbnail_intern.cpp @@ -30,6 +30,7 @@ #include "graphics/colormasks.h" #include "graphics/scaler.h" #include "graphics/scaler/intern.h" +#include "graphics/palette.h" template uint16 quadBlockInterpolate(const uint8 *src, uint32 srcPitch) { diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp index c581f9b265..13ea339375 100644 --- a/graphics/sjis.cpp +++ b/graphics/sjis.cpp @@ -31,6 +31,7 @@ #include "common/archive.h" #include "common/endian.h" #include "common/stream.h" +#include "common/textconsole.h" #include "graphics/surface.h" diff --git a/graphics/surface.cpp b/graphics/surface.cpp index f06c24c2cd..271e32fc0c 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -24,7 +24,8 @@ #include "common/algorithm.h" #include "common/util.h" -#include "common/endian.h" +#include "common/rect.h" +#include "common/textconsole.h" #include "graphics/primitives.h" #include "graphics/surface.h" diff --git a/graphics/surface.h b/graphics/surface.h index f9cb6cc474..92c7b7e899 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -26,7 +26,10 @@ #define GRAPHICS_SURFACE_H #include "common/scummsys.h" -#include "common/rect.h" + +namespace Common { +struct Rect; +} namespace Graphics { diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp index 8688096c3d..fa906ca517 100644 --- a/graphics/thumbnail.cpp +++ b/graphics/thumbnail.cpp @@ -28,6 +28,7 @@ #include "common/endian.h" #include "common/system.h" #include "common/stream.h" +#include "common/textconsole.h" namespace Graphics { diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp index 10939a677a..bae64f9303 100644 --- a/graphics/wincursor.cpp +++ b/graphics/wincursor.cpp @@ -23,12 +23,9 @@ * */ -#include "common/debug.h" -#include "common/file.h" -#include "common/memstream.h" #include "common/ptr.h" -#include "common/str.h" #include "common/stream.h" +#include "common/textconsole.h" #include "common/winexe_ne.h" #include "common/winexe_pe.h" -- cgit v1.2.3