Remove almost all includes of Serializer.h, include GameSaveError.h where necessary.

master
John Bartholomew 2017-12-23 02:57:02 +00:00
parent 33d1318a71
commit 7c3a13a0c0
66 changed files with 43 additions and 46 deletions

View File

@ -7,7 +7,7 @@
#include <cmath>
#include "JsonUtils.h"
#include "../../src/utils.h"
#include "../../src/Serializer.h" // Need this for the exceptions
#include "../../src/GameSaveError.h" // Need this for the exceptions
extern "C" {
#ifdef __GNUC__

View File

@ -17,6 +17,7 @@
#include "Space.h"
#include "Game.h"
#include "LuaEvent.h"
#include "GameSaveError.h"
#include "json/JsonUtils.h"
Body::Body() : PropertiedObject(Lua::manager)

View File

@ -8,7 +8,6 @@
#include "matrix4x4.h"
#include "Object.h"
#include "Frame.h"
#include "Serializer.h"
#include "PropertiedObject.h"
#include <string>

View File

@ -6,6 +6,7 @@
#include "AnimationCurves.h"
#include "Pi.h"
#include "Game.h"
#include "GameSaveError.h"
#include "json/JsonUtils.h"
CameraController::CameraController(RefCountedPtr<CameraContext> camera, const Ship *ship) :

View File

@ -7,7 +7,6 @@
#include "vector3.h"
#include "matrix4x4.h"
#include "Lang.h"
#include "Serializer.h"
#include "Camera.h"
#include "json/json.h"

View File

@ -5,7 +5,6 @@
#include "CargoBody.h"
#include "Game.h"
#include "Pi.h"
#include "Serializer.h"
#include "Sfx.h"
#include "Space.h"
#include "EnumStrings.h"
@ -13,6 +12,7 @@
#include "collider/collider.h"
#include "scenegraph/SceneGraph.h"
#include "scenegraph/ModelSkin.h"
#include "GameSaveError.h"
void CargoBody::SaveToJson(Json::Value &jsonObj, Space *space)
{

View File

@ -5,9 +5,9 @@
#include "DynamicBody.h"
#include "Space.h"
#include "Frame.h"
#include "Serializer.h"
#include "Planet.h"
#include "Pi.h"
#include "GameSaveError.h"
#include "json/JsonUtils.h"
#include "Propulsion.h"
#include "FixedGuns.h"

View File

@ -9,6 +9,7 @@
#include "enum_table.h"
#include "GameSaveError.h"
#include "LuaUtils.h"
#include "LuaVector.h"
#include "LuaFixed.h"

View File

@ -2,6 +2,7 @@
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#include "FixedGuns.h"
#include "GameSaveError.h"
FixedGuns::FixedGuns()
{

View File

@ -10,6 +10,7 @@
#include "Pi.h"
#include "Game.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
#include <algorithm>
Frame::Frame()

View File

@ -5,7 +5,6 @@
#define _FRAME_H
#include "libs.h"
#include "Serializer.h"
#include "IterationProxy.h"
#include "json/json.h"
#include <string>

View File

@ -26,6 +26,7 @@
#include "graphics/Renderer.h"
#include "ui/Context.h"
#include "galaxy/GalaxyGenerator.h"
#include "GameSaveError.h"
static const int s_saveVersion = 84;
static const char s_saveStart[] = "PIONEER";

View File

@ -8,7 +8,6 @@
#include "libs.h"
#include "gameconsts.h"
#include "GameLog.h"
#include "Serializer.h"
#include "galaxy/Galaxy.h"
#include "galaxy/SystemPath.h"

View File

@ -8,7 +8,6 @@
#include "perlin.h"
#include "Pi.h"
#include "Player.h"
#include "Serializer.h"
#include "Ship.h"
#include "Space.h"
#include "graphics/Graphics.h"
@ -17,6 +16,7 @@
#include "graphics/VertexArray.h"
#include "graphics/RenderState.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
using namespace Graphics;

View File

@ -19,6 +19,7 @@
#include "SystemInfoView.h"
#include "ShipCpanel.h"
#include "LuaPiGui.h"
#include "GameSaveError.h"
/*
* Interface: Game
@ -610,7 +611,7 @@ void LuaGame::Register()
{ "GetTimeAcceleration", l_game_get_time_acceleration },
{ "GetRequestedTimeAcceleration", l_game_get_requested_time_acceleration },
{ "GetHyperspaceTravelledPercentage", l_game_get_hyperspace_travelled_percentage },
{ "SetWorldCamType", l_game_set_world_cam_type },
{ "GetWorldCamType", l_game_get_world_cam_type },
{ "ToggleTargetActions", l_game_toggle_target_actions }, // deprecated

View File

@ -11,7 +11,6 @@
#include "LuaWrappable.h"
#include "RefCounted.h"
#include "DeleteEmitter.h"
#include "Serializer.h"
#include <typeinfo>
#include <tuple>

View File

@ -4,6 +4,7 @@
#include "LuaRef.h"
#include "Lua.h"
#include "Pi.h"
#include "GameSaveError.h"
#include <cassert>
LuaRef::LuaRef(const LuaRef & ref): m_lua(ref.m_lua), m_id(ref.m_id), m_copycount(ref.m_copycount) {

View File

@ -5,7 +5,6 @@
#define _LUAREF_H
#include "lua/lua.hpp"
#include "Serializer.h"
#include "json/json.h"
#include <vector>
#include <cassert>

View File

@ -3,6 +3,7 @@
#include "LuaSerializer.h"
#include "LuaObject.h"
#include "GameSaveError.h"
#include "json/JsonUtils.h"
// every module can save one object. that will usually be a table. we call

View File

@ -8,7 +8,6 @@
#include "LuaObject.h"
#include "LuaRef.h"
#include "DeleteEmitter.h"
#include "Serializer.h"
class LuaSerializer : public DeleteEmitter {
friend class LuaObject<LuaSerializer>;

View File

@ -20,6 +20,7 @@
#include "galaxy/GalaxyCache.h"
#include "Factions.h"
#include "FileSystem.h"
#include "GameSaveError.h"
/*
* Class: StarSystem

View File

@ -2,7 +2,6 @@
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#include "Missile.h"
#include "Serializer.h"
#include "Space.h"
#include "Sfx.h"
#include "ShipType.h"

View File

@ -7,7 +7,6 @@
#include "Game.h"
#include "ModelCache.h"
#include "Pi.h"
#include "Serializer.h"
#include "Space.h"
#include "WorldView.h"
#include "Camera.h"
@ -17,6 +16,7 @@
#include "scenegraph/SceneGraph.h"
#include "scenegraph/NodeVisitor.h"
#include "scenegraph/CollisionGeometry.h"
#include "GameSaveError.h"
class DynGeomFinder : public SceneGraph::NodeVisitor {
public:

View File

@ -18,6 +18,7 @@
#include "Pi.h"
#include "StringF.h"
#include "ModManager.h"
#include "GameSaveError.h"
#include <sstream>
//default options

View File

@ -7,6 +7,7 @@
#include "scenegraph/SceneGraph.h"
#include "IniConfig.h"
#include "FileSystem.h"
#include "GameSaveError.h"
#include "utils.h"
const float BILLBOARD_SIZE = 2.5f;

View File

@ -7,7 +7,6 @@
* Blinking navigation lights for ships and stations
*/
#include "libs.h"
#include "Serializer.h"
#include "json/json.h"
#include "graphics/RenderState.h"
#include "graphics/VertexArray.h"

View File

@ -4,8 +4,8 @@
#ifndef _PERSISTSYSTEMDATA_H
#define _PERSISTSYSTEMDATA_H
#include "Serializer.h"
#include "galaxy/SystemPath.h"
#include "GameSaveError.h"
#include <map>
template <typename T>

View File

@ -48,7 +48,6 @@
#include "Projectile.h"
#include "SDLWrappers.h"
#include "SectorView.h"
#include "Serializer.h"
#include "Sfx.h"
#include "ShipCpanel.h"
#include "ShipType.h"

View File

@ -8,7 +8,6 @@
#include "Lang.h"
#include "Pi.h"
#include "SectorView.h"
#include "Serializer.h"
#include "ShipCpanel.h"
#include "Sound.h"
#include "SpaceStation.h"

View File

@ -7,7 +7,6 @@
#include "Frame.h"
#include "galaxy/StarSystem.h"
#include "Space.h"
#include "Serializer.h"
#include "collider/collider.h"
#include "CargoBody.h"
#include "Planet.h"
@ -23,6 +22,7 @@
#include "graphics/VertexArray.h"
#include "graphics/TextureBuilder.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
std::unique_ptr<Graphics::VertexArray> Projectile::s_sideVerts;
std::unique_ptr<Graphics::VertexArray> Projectile::s_glowVerts;

View File

@ -7,7 +7,6 @@
#include "LuaManager.h"
#include "LuaRef.h"
#include "LuaTable.h"
#include "Serializer.h"
#include "libs.h"
struct lua_State;

View File

@ -6,6 +6,7 @@
#include "Game.h"
#include "Object.h" // <- here only for comment in AIFaceDirection (line 320)
#include "KeyBindings.h" // <- same here
#include "GameSaveError.h"
void Propulsion::SaveToJson(Json::Value &jsonObj, Space *space)
{

View File

@ -9,7 +9,6 @@
#include "Pi.h"
#include "Player.h"
#include "SectorView.h"
#include "Serializer.h"
#include "ShipCpanel.h"
#include "StringF.h"
#include "SystemInfoView.h"
@ -22,6 +21,7 @@
#include "graphics/Renderer.h"
#include "gui/Gui.h"
#include "KeyBindings.h"
#include "GameSaveError.h"
#include <algorithm>
#include <sstream>
#include <SDL_stdinc.h>

View File

@ -9,7 +9,6 @@
#include "Quaternion.h"
#include "vector2.h"
#include "vector3.h"
#include "GameSaveError.h"
namespace Serializer {

View File

@ -17,6 +17,7 @@
#include "graphics/Renderer.h"
#include "graphics/TextureBuilder.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
using namespace Graphics;

View File

@ -5,7 +5,6 @@
#define _SFX_H
#include "Body.h"
#include "Serializer.h"
#include "graphics/Material.h"
#include "graphics/RenderState.h"

View File

@ -9,6 +9,7 @@
#include "Ship.h"
#include "Pi.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
#include <sstream>
namespace {

View File

@ -7,7 +7,6 @@
* Mesh shields for ships and other objects.
*/
#include "libs.h"
#include "Serializer.h"
#include "json/json.h"
#include <deque>

View File

@ -11,7 +11,6 @@
#include "NavLights.h"
#include "Planet.h"
#include "Sensors.h"
#include "Serializer.h"
#include "ShipType.h"
#include "Space.h"
#include "scenegraph/SceneGraph.h"

View File

@ -6,10 +6,10 @@
#include "Ship.h"
#include "SpaceStation.h"
#include "Serializer.h"
#include "Pi.h"
#include "Game.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
#include "libs.h"
class AICommand {

View File

@ -11,6 +11,7 @@
#include "Space.h"
#include "WorldView.h"
#include "OS.h"
#include "GameSaveError.h"
void ShipController::StaticUpdate(float timeStep)
{

View File

@ -8,7 +8,6 @@
* Controls thrusters, autopilot according to player input or AI
*/
#include "libs.h"
#include "Serializer.h"
#include "json/json.h"
class Body;

View File

@ -14,6 +14,7 @@
#include "UIView.h"
#include "Lang.h"
#include "Game.h"
#include "GameSaveError.h"
// XXX duplicated in WorldView. should probably be a theme variable
static const Color s_hudTextColor(0,255,0,204);

View File

@ -8,7 +8,6 @@
#include "gui/Gui.h"
#include "ShipCpanelMultiFuncDisplays.h"
#include "Ship.h"
#include "Serializer.h"
#include "Game.h"
#include "WorldView.h"

View File

@ -20,6 +20,7 @@
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "graphics/VertexArray.h"
#include "GameSaveError.h"
using namespace Graphics;

View File

@ -5,7 +5,6 @@
#define _SHIPCPANELMULTIFUNCDISPLAYS_H
#include "gui/Gui.h"
#include "Serializer.h"
#include "Object.h"
#include "json/json.h"

View File

@ -15,7 +15,6 @@
#include "galaxy/Galaxy.h"
#include "galaxy/StarSystem.h"
#include "SpaceStation.h"
#include "Serializer.h"
#include "collider/collider.h"
#include "Missile.h"
#include "HyperspaceCloud.h"

View File

@ -7,7 +7,6 @@
#include <list>
#include "Object.h"
#include "vector3.h"
#include "Serializer.h"
#include "RefCounted.h"
#include "galaxy/GalaxyCache.h"
#include "galaxy/StarSystem.h"

View File

@ -14,7 +14,6 @@
#include "Planet.h"
#include "Player.h"
#include "Polit.h"
#include "Serializer.h"
#include "Ship.h"
#include "Space.h"
#include "StringF.h"
@ -23,6 +22,7 @@
#include "graphics/Graphics.h"
#include "scenegraph/ModelSkin.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
#include <algorithm>
void SpaceStation::Init()

View File

@ -9,7 +9,6 @@
#include "ModelBody.h"
#include "NavLights.h"
#include "Quaternion.h"
#include "Serializer.h"
#include "ShipType.h"
#include "SpaceStationType.h"

View File

@ -10,6 +10,7 @@
#include "Game.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "GameSaveError.h"
TerrainBody::TerrainBody(SystemBody *sbody) :
Body(),

View File

@ -5,7 +5,6 @@
#define _VIEW_H
#include "libs.h"
#include "Serializer.h"
#include "gui/Gui.h"
#include "json/json.h"

View File

@ -12,7 +12,6 @@
#include "galaxy/GalaxyCache.h"
#include "SectorView.h"
#include "SystemView.h"
#include "Serializer.h"
#include "Sound.h"
#include "Space.h"
#include "SpaceStation.h"
@ -35,6 +34,7 @@
#include "Quaternion.h"
#include "LuaObject.h"
#include "utils.h"
#include "GameSaveError.h"
#include <algorithm>
#include <sstream>
#include <iomanip>

View File

@ -8,7 +8,6 @@
#include "gui/Gui.h"
#include "gui/GuiWidget.h"
#include "UIView.h"
#include "Serializer.h"
#include "SpeedLines.h"
#include "Background.h"
#include "Camera.h"

View File

@ -8,6 +8,7 @@
#include "Sector.h"
#include "Pi.h"
#include "FileSystem.h"
#include "GameSaveError.h"
Galaxy::Galaxy(RefCountedPtr<GalaxyGenerator> galaxyGenerator, float radius, float sol_offset_x, float sol_offset_y,
const std::string& factionsDir, const std::string& customSysDir)

View File

@ -6,7 +6,6 @@
#include <cstdio>
#include "RefCounted.h"
#include "Serializer.h"
#include "Factions.h"
#include "CustomSystem.h"
#include "GalaxyCache.h"

View File

@ -6,6 +6,7 @@
#include "GalaxyGenerator.h"
#include "SectorGenerator.h"
#include "galaxy/StarSystemGenerator.h"
#include "GameSaveError.h"
static const GalaxyGenerator::Version LAST_VERSION_LEGACY = 1;

View File

@ -7,7 +7,6 @@
#include <list>
#include <string>
#include "RefCounted.h"
#include "Serializer.h"
#include "Sector.h"
#include "StarSystem.h"
#include "SystemPath.h"

View File

@ -8,19 +8,19 @@
#include "GalaxyGenerator.h"
#include "Factions.h"
#include "Serializer.h"
#include "Pi.h"
#include "LuaEvent.h"
#include "enum_table.h"
#include <map>
#include <string>
#include <algorithm>
#include "utils.h"
#include "Orbit.h"
#include "Lang.h"
#include "StringF.h"
#include <SDL_stdinc.h>
#include "EnumStrings.h"
#include "GameSaveError.h"
#include <SDL_stdinc.h>
#include <map>
#include <string>
#include <algorithm>
//#define DEBUG_DUMP

View File

@ -7,7 +7,6 @@
#include "libs.h"
#include "galaxy/Economy.h"
#include "Polit.h"
#include "Serializer.h"
#include <vector>
#include <string>
#include "RefCounted.h"

View File

@ -2,7 +2,7 @@
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#include "SystemPath.h"
#include "Serializer.h"
#include "GameSaveError.h"
#include "json/json.h"
#include <cstdlib>

View File

@ -25,6 +25,7 @@
#include "OS.h"
#include "StringF.h"
#include "ModManager.h"
#include "GameSaveError.h"
#include <sstream>
std::unique_ptr<GameConfig> s_config;

View File

@ -6,6 +6,7 @@
#include "FileSystem.h"
#include "StringF.h"
#include "utils.h"
#include "GameSaveError.h"
extern "C" {
#include "miniz/miniz.h"

View File

@ -12,6 +12,7 @@
#include "FindNodeVisitor.h"
#include "Thruster.h"
#include "utils.h"
#include "GameSaveError.h"
namespace SceneGraph {

View File

@ -6,6 +6,7 @@
#include "StringF.h"
#include "graphics/TextureBuilder.h"
#include "json/JsonUtils.h"
#include "GameSaveError.h"
#include "RandomColor.h"

View File

@ -54,7 +54,6 @@
#include "Planet.h"
#include "Player.h"
#include "SectorView.h"
#include "Serializer.h"
#include "Sfx.h"
#include "Ship.h"
#include "ShipCpanel.h"