shithub: cstory

Download patch

ref: 32c8795ead02ad4b921f6596cf8f599fd6084fc3
parent: cf6a3d9a4822ba3207a599f3803c8e465348fbc6
author: Gabriel Ravier <gabravier@gmail.com>
date: Wed Jul 1 14:26:22 EDT 2020

src: Cleaned up includes to only (and always) include what we use

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>

--- a/src/Backends/Audio/SDL2.cpp
+++ b/src/Backends/Audio/SDL2.cpp
@@ -1,11 +1,13 @@
 #include "../Audio.h"
 
 #include <stddef.h>
-#include <stdio.h>
 #include <string.h>
 #include <string>
 
 #include "SDL.h"
+#include "SDL_audio.h"
+#include "SDL_error.h"
+#include "SDL_stdinc.h"
 
 #include "../Misc.h"
 
--- a/src/Backends/Audio/SoftwareMixer.cpp
+++ b/src/Backends/Audio/SoftwareMixer.cpp
@@ -2,9 +2,7 @@
 
 #include <math.h>
 #include <stddef.h>
-#include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "../../Attributes.h"
 
--- a/src/Backends/Audio/miniaudio.cpp
+++ b/src/Backends/Audio/miniaudio.cpp
@@ -1,6 +1,7 @@
 #include "../Audio.h"
 
 #include <stddef.h>
+#include <string.h>
 
 #define MINIAUDIO_IMPLEMENTATION
 #define MA_NO_DECODING
--- a/src/Backends/Controller/SDL2.cpp
+++ b/src/Backends/Controller/SDL2.cpp
@@ -1,8 +1,12 @@
 #include "../Controller.h"
 
 #include <stddef.h>
+#include <stdlib.h>
 
 #include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_joystick.h"
+#include "SDL_stdinc.h"
 
 #include "../Misc.h"
 #include "../Shared/SDL2.h"
--- a/src/Backends/Platform/GLFW3.cpp
+++ b/src/Backends/Platform/GLFW3.cpp
@@ -17,7 +17,6 @@
 #include "../../Main.h"
 #include "../../Organya.h"
 #include "../../Profile.h"
-#include "../../Resource.h"
 
 #define DO_KEY(GLFW_KEY, BACKEND_KEY) \
 	case GLFW_KEY: \
--- a/src/Backends/Platform/Null.cpp
+++ b/src/Backends/Platform/Null.cpp
@@ -2,6 +2,8 @@
 
 #include <string>
 
+#include "../../Attributes.h"
+
 bool Backend_Init(void)
 {
 	return true;
--- a/src/Backends/Platform/SDL2.cpp
+++ b/src/Backends/Platform/SDL2.cpp
@@ -1,18 +1,32 @@
 #include "../Misc.h"
 
+#include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string>
 
 #include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_filesystem.h"
+#include "SDL_keyboard.h"
+#include "SDL_keycode.h"
+#include "SDL_messagebox.h"
+#include "SDL_mouse.h"
+#include "SDL_pixels.h"
+#include "SDL_stdinc.h"
+#include "SDL_surface.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
 
 #include "../Rendering.h"
 #include "../Shared/SDL2.h"
+#include "../../Attributes.h"
 #include "../../Main.h"
 #include "../../Organya.h"
 #include "../../Profile.h"
-#include "../../Resource.h"
 
 #define DO_KEY(SDL_KEY, BACKEND_KEY) \
 	case SDL_KEY: \
--- a/src/Backends/Rendering/OpenGL3.cpp
+++ b/src/Backends/Rendering/OpenGL3.cpp
@@ -15,11 +15,8 @@
 #define SPRITEBATCH_IMPLEMENTATION
 #include "../../../external/cute_spritebatch.h"
 
-#include "../../WindowsWrapper.h"
-
 #include "../Misc.h"
 #include "Window/OpenGL.h"
-#include "../../Resource.h"
 
 #define TOTAL_VBOS 8
 
--- a/src/Backends/Rendering/SDLSurface.cpp
+++ b/src/Backends/Rendering/SDLSurface.cpp
@@ -5,10 +5,14 @@
 #include <string.h>
 #include <string>
 
-#include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_pixels.h"
+#include "SDL_rect.h"
+#include "SDL_stdinc.h"
+#include "SDL_surface.h"
+#include "SDL_video.h"
 
 #include "../Misc.h"
-#include "../Shared/SDL2.h"
 
 typedef struct RenderBackend_Surface
 {
--- a/src/Backends/Rendering/SDLTexture.cpp
+++ b/src/Backends/Rendering/SDLTexture.cpp
@@ -5,7 +5,15 @@
 #include <string.h>
 #include <string>
 
-#include "SDL.h"
+#include "SDL_blendmode.h"
+#include "SDL_error.h"
+#include "SDL_hints.h"
+#include "SDL_pixels.h"
+#include "SDL_rect.h"
+#include "SDL_render.h"
+#include "SDL_stdinc.h"
+#include "SDL_version.h"
+#include "SDL_video.h"
 
 #define SPRITEBATCH_IMPLEMENTATION
 #include "../../../external/cute_spritebatch.h"
@@ -13,11 +21,6 @@
 #include "../../WindowsWrapper.h"
 
 #include "../Misc.h"
-#include "../Shared/SDL2.h"
-#include "../../Draw.h"
-#include "../../Ending.h"
-#include "../../MapName.h"
-#include "../../TextScr.h"
 
 typedef struct RenderBackend_Surface
 {
--- a/src/Backends/Rendering/Window/OpenGL3/GLFW3.cpp
+++ b/src/Backends/Rendering/Window/OpenGL3/GLFW3.cpp
@@ -1,17 +1,13 @@
 #include "../OpenGL.h"
 
 #include <stddef.h>
-#include <stdlib.h>
 
-#ifdef USE_OPENGLES2
-#include <GLES2/gl2.h>
-#else
+#ifndef USE_OPENGLES2
 #include <glad/glad.h>
 #endif
 #include <GLFW/glfw3.h>
 
 #include "../../../Misc.h"
-#include "../../../Shared/GLFW3.h"
 
 GLFWwindow *window;
 
--- a/src/Backends/Rendering/Window/OpenGL3/SDL2.cpp
+++ b/src/Backends/Rendering/Window/OpenGL3/SDL2.cpp
@@ -3,15 +3,13 @@
 #include <stddef.h>
 #include <string>
 
-#ifdef USE_OPENGLES2
-#include <GLES2/gl2.h>
-#else
+#ifndef USE_OPENGLES2
 #include <glad/glad.h>
 #endif
-#include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
 
 #include "../../../Misc.h"
-#include "../../../Shared/SDL2.h"
 
 SDL_Window *window;
 
--- a/src/Backends/Rendering/Window/Software/GLFW3.cpp
+++ b/src/Backends/Rendering/Window/Software/GLFW3.cpp
@@ -11,7 +11,6 @@
 #include <GLFW/glfw3.h>
 
 #include "../../../Misc.h"
-#include "../../../Shared/GLFW3.h"
 
 GLFWwindow *window;
 
--- a/src/Backends/Rendering/Window/Software/SDL2.cpp
+++ b/src/Backends/Rendering/Window/Software/SDL2.cpp
@@ -1,13 +1,14 @@
 #include "../Software.h"
 
 #include <stddef.h>
-#include <stdlib.h>
 #include <string>
 
-#include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_pixels.h"
+#include "SDL_surface.h"
+#include "SDL_video.h"
 
 #include "../../../Misc.h"
-#include "../../../Shared/SDL2.h"
 
 SDL_Window *window;
 
--- a/src/BossFrog.cpp
+++ b/src/BossFrog.cpp
@@ -1,5 +1,7 @@
 #include "BossFrog.h"
 
+#include <stddef.h>
+
 #include "WindowsWrapper.h"
 
 #include "Boss.h"
--- a/src/BossIronH.cpp
+++ b/src/BossIronH.cpp
@@ -1,5 +1,7 @@
 #include "BossIronH.h"
 
+#include <stddef.h>
+
 #include "WindowsWrapper.h"
 
 #include "Boss.h"
--- a/src/BossPress.cpp
+++ b/src/BossPress.cpp
@@ -1,5 +1,7 @@
 #include "BossPress.h"
 
+#include <stddef.h>
+
 #include "WindowsWrapper.h"
 
 #include "Boss.h"
--- a/src/BossTwinD.cpp
+++ b/src/BossTwinD.cpp
@@ -1,5 +1,7 @@
 #include "BossTwinD.h"
 
+#include <stddef.h>
+
 #include "WindowsWrapper.h"
 
 #include "Boss.h"
--- a/src/BulHit.cpp
+++ b/src/BulHit.cpp
@@ -1,5 +1,9 @@
 #include "BulHit.h"
 
+#include <stddef.h>
+
+#include "WindowsWrapper.h"
+
 #include "Bullet.h"
 #include "Caret.h"
 #include "Game.h"
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -1,7 +1,6 @@
 #include "Draw.h"
 
 #include <stddef.h>
-#include <stdio.h>
 #include <string.h>
 #include <string>
 
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -1,6 +1,5 @@
 #include "Font.h"
 
-#include <math.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
@@ -9,9 +8,6 @@
 #include FT_FREETYPE_H
 #include FT_BITMAP_H
 
-#include "WindowsWrapper.h"
-
-#include "Draw.h"
 #include "File.h"
 #include "Backends/Rendering.h"
 
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -1,8 +1,6 @@
 #include "Game.h"
 
 #include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string>
 
 #include "WindowsWrapper.h"
--- a/src/GenericLoad.cpp
+++ b/src/GenericLoad.cpp
@@ -1,7 +1,5 @@
 #include "GenericLoad.h"
 
-#include <stdio.h>
-
 #include "WindowsWrapper.h"
 
 #include "CommonDefines.h"
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -1,7 +1,5 @@
 #include "Main.h"
 
-#include <stddef.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string>
@@ -9,12 +7,10 @@
 #include "WindowsWrapper.h"
 
 #include "Backends/Misc.h"
-#include "Backends/Rendering.h"
 #include "Bitmap.h"
 #include "CommonDefines.h"
 #include "Config.h"
 #include "Draw.h"
-#include "File.h"
 #include "Game.h"
 #include "Generic.h"
 #include "Input.h"
@@ -21,7 +17,6 @@
 #include "KeyControl.h"
 #include "MyChar.h"
 #include "Organya.h"
-#include "Profile.h"
 #include "Resource.h"
 #include "Sound.h"
 #include "Triangle.h"
--- a/src/NpcAct240.cpp
+++ b/src/NpcAct240.cpp
@@ -1,5 +1,7 @@
 #include "NpcAct.h"
 
+#include <stddef.h>
+
 #include "WindowsWrapper.h"
 
 #include "Caret.h"
--- a/src/PixTone.cpp
+++ b/src/PixTone.cpp
@@ -1,7 +1,6 @@
 #include "PixTone.h"
 
 #include <math.h>
-#include <stdlib.h>
 #include <string.h>
 
 #include "WindowsWrapper.h"
--- a/src/Sound.cpp
+++ b/src/Sound.cpp
@@ -20,7 +20,6 @@
 #include "WindowsWrapper.h"
 
 #include "Backends/Audio.h"
-#include "Main.h"
 #include "Organya.h"
 #include "PixTone.h"
 
--- a/src/Stage.cpp
+++ b/src/Stage.cpp
@@ -1,7 +1,5 @@
 #include "Stage.h"
 
-#include <stdio.h>
-#include <string.h>
 #include <string>
 
 #include "WindowsWrapper.h"