From e13755b1d99e9ed87bae045cb3dd440bfc802c89 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 1 Aug 2020 12:28:00 +1000 Subject: [PATCH] avoid including bitmap.h in h files --- src/Game.h | 2 +- src/Graphics.c | 1 + src/Graphics.h | 2 +- src/Utils.h | 2 +- src/Window.c | 1 + src/Window.h | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Game.h b/src/Game.h index 80302d697..e16bdf217 100644 --- a/src/Game.h +++ b/src/Game.h @@ -1,11 +1,11 @@ #ifndef CC_GAME_H #define CC_GAME_H #include "String.h" -#include "Bitmap.h" /* Represents the game and related structures. Copyright 2014-2020 ClassiCube | Licensed under BSD-3 */ +struct Bitmap; struct Stream; CC_VAR extern struct _GameData { /* Width and height of the window. (1 at minimum) */ diff --git a/src/Graphics.c b/src/Graphics.c index 619e3b811..98918508a 100644 --- a/src/Graphics.c +++ b/src/Graphics.c @@ -11,6 +11,7 @@ #include "ExtMath.h" #include "Errors.h" #include "Options.h" +#include "Bitmap.h" /* Avoid pointless includes on Windows */ #define WIN32_LEAN_AND_MEAN diff --git a/src/Graphics.h b/src/Graphics.h index f6592ca6e..ff9d91a55 100644 --- a/src/Graphics.h +++ b/src/Graphics.h @@ -1,12 +1,12 @@ #ifndef CC_GFXAPI_H #define CC_GFXAPI_H #include "Vectors.h" -#include "Bitmap.h" #include "PackedCol.h" /* Abstracts a 3D graphics rendering API. Copyright 2014-2020 ClassiCube | Licensed under BSD-3 */ +struct Bitmap; struct Stream; struct IGameComponent; extern struct IGameComponent Gfx_Component; diff --git a/src/Utils.h b/src/Utils.h index 2f643bc29..b1e2cb189 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -1,11 +1,11 @@ #ifndef CC_UTILS_H #define CC_UTILS_H #include "String.h" -#include "Bitmap.h" /* Implements various utility functions. Copyright 2014-2020 ClassiCube | Licensed under BSD-3 */ +struct Bitmap; /* Represents a particular instance in time in some timezone. Not necessarily UTC time. */ /* NOTE: TimeMS and DateTime_CurrentUTC_MS() should almost always be used instead. */ /* This struct should only be used when actually needed. (e.g. log message time) */ diff --git a/src/Window.c b/src/Window.c index b3db9940c..189985c60 100644 --- a/src/Window.c +++ b/src/Window.c @@ -5,6 +5,7 @@ #include "Logger.h" #include "Funcs.h" #include "ExtMath.h" +#include "Bitmap.h" struct _DisplayData DisplayInfo; struct _WinData WindowInfo; diff --git a/src/Window.h b/src/Window.h index 24adbf2eb..a2f9c243a 100644 --- a/src/Window.h +++ b/src/Window.h @@ -1,7 +1,6 @@ #ifndef CC_WINDOW_H #define CC_WINDOW_H #include "String.h" -#include "Bitmap.h" /* Abstracts creating and managing the native window. Copyright 2014-2020 ClassiCube | Licensed under BSD-3 | Based on OpenTK code */ @@ -31,6 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE. */ +struct Bitmap; struct DynamicLibSym; /* The states the window can be in. */ enum WindowState { WINDOW_STATE_NORMAL, WINDOW_STATE_MINIMISED, WINDOW_STATE_FULLSCREEN };