1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

rwengine: iwyu: reduce warnings in engine subdirectory

This commit is contained in:
Anonymous Maarten 2017-10-31 04:05:12 +01:00 committed by Daniel Evans
parent a7203e00a0
commit fb58dfb082
24 changed files with 212 additions and 136 deletions

View File

@ -4,6 +4,7 @@
#include <limits>
#include <utility>
#include <btBulletDynamicsCommon.h>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/quaternion.hpp>

View File

@ -9,12 +9,12 @@
#include <utility>
#include <vector>
#include <data/Clump.hpp>
#include <rw/defines.hpp>
#include <rw/forward.hpp>
#include "data/CollisionModel.hpp"
#include "data/Clump.hpp"
#include "data/PathData.hpp"
#include <data/CollisionModel.hpp>
#include <data/PathData.hpp>
#ifdef RW_WINDOWS
#include <rw_mingw.hpp>
#endif

View File

@ -1,8 +1,14 @@
#include "engine/Animator.hpp"
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <data/Clump.hpp>
#include <engine/Animator.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <loaders/LoaderDFF.hpp>
#include <queue>
#include "loaders/LoaderIFP.hpp"
#include <algorithm>
#include <cmath>
Animator::Animator(ClumpPtr model) : model(model) {
}

View File

@ -1,14 +1,12 @@
#pragma once
#ifndef _ANIMATOR_HPP_
#define _ANIMATOR_HPP_
#include <cstdint>
#include <glm/glm.hpp>
#include <glm/gtx/quaternion.hpp>
#include <loaders/LoaderIFP.hpp>
#ifndef _RWENGINE_ANIMATOR_HPP_
#define _RWENGINE_ANIMATOR_HPP_
#include <map>
#include <rw/defines.hpp>
#include <vector>
#include <rw/defines.hpp>
#include <rw/forward.hpp>
struct AnimationBone;
class ModelFrame;
/**

View File

@ -1,24 +1,35 @@
#include <data/Clump.hpp>
#include <data/ModelData.hpp>
#include <data/WeaponData.hpp>
#include <engine/GameData.hpp>
#include <engine/GameState.hpp>
#include <engine/GameWorld.hpp>
#include <loaders/LoaderCOL.hpp>
#include <loaders/LoaderIDE.hpp>
#include <loaders/LoaderIPL.hpp>
#include <platform/FileHandle.hpp>
#include <script/SCMFile.hpp>
#include <core/Logger.hpp>
#include <loaders/GenericDATLoader.hpp>
#include <loaders/LoaderGXT.hpp>
#include <platform/FileIndex.hpp>
#include "engine/GameData.hpp"
#include <algorithm>
#include <boost/algorithm/string/predicate.hpp>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include <iterator>
#include <stdexcept>
#include <boost/algorithm/string/predicate.hpp>
#include <data/Clump.hpp>
#include <rw/defines.hpp>
#include <rw/types.hpp>
#include "core/Logger.hpp"
//#include "data/WeaponData.hpp"
#include "engine/GameState.hpp"
#include "engine/GameWorld.hpp"
#include "loaders/LoaderCOL.hpp"
#include "loaders/LoaderDFF.hpp"
#include "loaders/LoaderIDE.hpp"
#include "loaders/LoaderIFP.hpp"
#include "loaders/LoaderIMG.hpp"
#include "loaders/LoaderIPL.hpp"
#include "loaders/LoaderTXD.hpp"
#include "platform/FileHandle.hpp"
#include "script/SCMFile.hpp"
#include "loaders/GenericDATLoader.hpp"
#include "loaders/LoaderGXT.hpp"
#include "platform/FileIndex.hpp"
GameData::GameData(Logger* log, const rwfs::path& path)
: datpath(path), logger(log), engine(nullptr) {

View File

@ -1,28 +1,35 @@
#pragma once
#ifndef _GAMEDATA_HPP_
#define _GAMEDATA_HPP_
#ifndef _RWENGINE_GAMEDATA_HPP_
#define _RWENGINE_GAMEDATA_HPP_
class Logger;
#include <array>
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include <glm/glm.hpp>
#include <platform/FileIndex.hpp>
#include <rw/defines.hpp>
#include <rw/forward.hpp>
#include <data/GameTexts.hpp>
#include <data/ModelData.hpp>
#include <data/PedData.hpp>
#include <data/ZoneData.hpp>
#include <data/AnimGroup.hpp>
#include <loaders/LoaderDFF.hpp>
#include <loaders/LoaderIDE.hpp>
#include <loaders/LoaderIFP.hpp>
#include <loaders/LoaderIMG.hpp>
#include <loaders/LoaderTXD.hpp>
#include <loaders/WeatherLoader.hpp>
#include <objects/VehicleInfo.hpp>
#include <rw/types.hpp>
#include <gl/TextureData.hpp>
#include <platform/FileIndex.hpp>
#include <memory>
struct DynamicObjectData;
class Logger;
struct WeaponData;
class GameWorld;
class TextureAtlas;

View File

@ -1,4 +1,4 @@
#include <engine/GameState.hpp>
#include "engine/GameState.hpp"
BasicState::BasicState()
: saveName{0}

View File

@ -1,21 +1,23 @@
#pragma once
#ifndef _GAMESTATE_HPP_
#define _GAMESTATE_HPP_
#ifndef _RWENGINE_GAMESTATE_HPP_
#define _RWENGINE_GAMESTATE_HPP_
#include <bitset>
#include <cstdint>
#include <string>
#include <map>
#include <vector>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <data/GameTexts.hpp>
#include <data/VehicleGenerator.hpp>
#include <engine/GameInputState.hpp>
#include <engine/ScreenText.hpp>
#include <glm/glm.hpp>
#include <glm/gtx/quaternion.hpp>
#include <map>
#include <objects/ObjectTypes.hpp>
#include <string>
#include <vector>
class GameWorld;
class GameObject;
class ScriptMachine;
class PlayerController;
struct CutsceneData;
struct SystemTime {

View File

@ -1,33 +1,40 @@
#include "engine/GameWorld.hpp"
//#include <LinearMath/btScalar.h>
//#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <btBulletDynamicsCommon.h>
#include <glm/gtx/norm.hpp>
#include <data/Clump.hpp>
#include <engine/GameData.hpp>
#include <engine/GameState.hpp>
#include "core/Logger.hpp"
#include <core/Logger.hpp>
#include "engine/GameData.hpp"
#include "engine/GameState.hpp"
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <ai/DefaultAIController.hpp>
#include <ai/TrafficDirector.hpp>
#include <data/WeaponData.hpp>
#include <loaders/LoaderIDE.hpp>
#include <loaders/LoaderIPL.hpp>
#include "ai/DefaultAIController.hpp"
#include "ai/PlayerController.hpp"
#include "ai/TrafficDirector.hpp"
// 3 isn't enough to cause a factory.
#include <objects/CharacterObject.hpp>
#include <objects/CutsceneObject.hpp>
#include <objects/InstanceObject.hpp>
#include <objects/ItemPickup.hpp>
#include <objects/VehicleObject.hpp>
#include "data/CutsceneData.hpp"
#include "data/WeaponData.hpp"
#include "loaders/LoaderCutsceneDAT.hpp"
#include "loaders/LoaderIPL.hpp"
#include "objects/CharacterObject.hpp"
#include "objects/CutsceneObject.hpp"
#include "objects/InstanceObject.hpp"
#include "objects/ItemPickup.hpp"
#include "objects/VehicleObject.hpp"
#include "render/ViewCamera.hpp"
#include <data/CutsceneData.hpp>
#include <loaders/LoaderCutsceneDAT.hpp>
#ifdef RW_WINDOWS
#include <rw_mingw.hpp>
#endif
#include <render/ViewCamera.hpp>
// Behaviour Tuning
constexpr float kMaxTrafficSpawnRadius = 100.f;
@ -210,8 +217,6 @@ void GameWorld::cleanupTraffic(const ViewCamera& focus) {
destroyQueuedObjects();
}
#include <ai/PlayerController.hpp>
#include <core/Logger.hpp>
CutsceneObject* GameWorld::createCutsceneObject(const uint16_t id,
const glm::vec3& pos,
const glm::quat& rot) {

View File

@ -1,18 +1,43 @@
#ifndef _GAMEWORLD_HPP_
#define _GAMEWORLD_HPP_
#ifndef _RWENGINE_GAMEWORLD_HPP_
#define _RWENGINE_GAMEWORLD_HPP_
#include <cstdint>
#include <map>
#include <memory>
#include <random>
#include <set>
#include <string>
#include <vector>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <LinearMath/btScalar.h>
#include <ai/AIGraph.hpp>
#include <ai/AIGraphNode.hpp>
#include <audio/SoundManager.hpp>
#include <objects/ObjectTypes.hpp>
#include <render/VisualFX.hpp>
#include <data/Chase.hpp>
class btCollisionDispatcher;
class btDefaultCollisionConfiguration;
class btDiscreteDynamicsWorld;
class btDynamicsWorld;
class btManifoldPoint;
class btOverlappingPairCallback;
class btSequentialImpulseConstraintSolver;
struct btDbvtBroadphase;
class GameState;
class PlayerController;
class Logger;
class GameData;
#include <ai/AIGraph.hpp>
#include <ai/AIGraphNode.hpp>
#include <audio/SoundManager.hpp>
#include <engine/GameState.hpp>
class CutsceneObject;
#include <objects/ObjectTypes.hpp>
class GameObject;
class CharacterObject;
@ -21,27 +46,11 @@ class VehicleObject;
class PickupObject;
class ViewCamera;
#include <data/ModelData.hpp>
#include <render/VisualFX.hpp>
struct BlipData;
struct WeaponScan;
struct VehicleGenerator;
#include <data/Chase.hpp>
#include <glm/glm.hpp>
#include <data/Clump.hpp>
#include <btBulletCollisionCommon.h>
#include <btBulletDynamicsCommon.h>
#include <array>
#include <random>
#include <set>
#include <vector>
/**
* Information about "Goal" locations so they can be rendered
* (this doesn't really belong here).

View File

@ -1,18 +1,33 @@
#include <ai/PlayerController.hpp>
#include "engine/SaveGame.hpp"
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <engine/GameData.hpp>
#include <engine/GameState.hpp>
#include <engine/GameWorld.hpp>
#include <engine/SaveGame.hpp>
#include <objects/CharacterObject.hpp>
#include <objects/GameObject.hpp>
#include <objects/InstanceObject.hpp>
#include <objects/VehicleObject.hpp>
#include <script/SCMFile.hpp>
#include <script/ScriptMachine.hpp>
#include <cstdio>
#if RW_DEBUG
#include <iostream>
#endif
#include <rw/filesystem.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <rw/defines.hpp>
#include "data/ZoneData.hpp"
#include "engine/GameData.hpp"
#include "engine/GameState.hpp"
#include "engine/GameWorld.hpp"
#include "objects/CharacterObject.hpp"
#include "objects/GameObject.hpp"
#include "objects/InstanceObject.hpp"
#include "objects/VehicleObject.hpp"
#include "script/SCMFile.hpp"
#include "script/ScriptMachine.hpp"
#include "script/ScriptTypes.hpp"
// Original save game file data structures
typedef uint16_t BlockWord;
typedef uint32_t BlockDword;
@ -484,23 +499,23 @@ bool readBlock(std::FILE* str, T& out) {
#define READ_VALUE(var) \
if (!readBlock(loadFile, var)) { \
std::cerr << file << ": Failed to load block " #var << std::endl; \
RW_ERROR(file << ": Failed to load block " #var); \
return false; \
}
#define READ_SIZE(var) \
if (!readBlock(loadFile, var)) { \
std::cerr << file << ": Failed to load size " #var << std::endl; \
RW_ERROR(file << ": Failed to load size " #var); \
return false; \
}
#define CHECK_SIG(expected) \
{ \
char signature[4]; \
if (fread(signature, sizeof(char), 4, loadFile) != 4) { \
std::cerr << "Failed to read signature" << std::endl; \
RW_ERROR("Failed to read signature"); \
return false; \
} \
if (strncmp(signature, expected, 3) != 0) { \
std::cerr << "Signature " expected " incorrect" << std::endl; \
RW_ERROR("Signature " expected " incorrect"); \
return false; \
} \
}
@ -512,7 +527,7 @@ bool readBlock(std::FILE* str, T& out) {
bool SaveGame::loadGame(GameState& state, const std::string& file) {
std::FILE* loadFile = std::fopen(file.c_str(), "rb");
if (loadFile == nullptr) {
std::cerr << "Failed to open save file" << std::endl;
RW_ERROR("Failed to open save file");
return false;
}
@ -538,7 +553,7 @@ bool SaveGame::loadGame(GameState& state, const std::string& file) {
if (fread(state.script->getGlobals(), sizeof(SCMByte), scriptVarCount,
loadFile) != scriptVarCount) {
std::cerr << "Failed to read script memory" << std::endl;
RW_ERROR("Failed to read script memory");
return false;
}

View File

@ -1,16 +1,10 @@
#pragma once
#ifndef _SAVEGAME_HPP_
#define _SAVEGAME_HPP_
#include <rw/types.hpp>
#include <engine/GameState.hpp>
#ifndef _RWENGINE_SAVEGAME_HPP_
#define _RWENGINE_SAVEGAME_HPP_
#include <string>
#include <vector>
class GameWorld;
class ScriptMachine;
#include <engine/GameState.hpp>
struct SaveGameInfo {
std::string savePath;

View File

@ -1,4 +1,6 @@
#include <engine/ScreenText.hpp>
#include "engine/ScreenText.hpp"
#include <rw/defines.hpp>
void ScreenText::tick(float dt) {
int millis = dt * 1000;

View File

@ -1,12 +1,15 @@
#ifndef RWENGINE_SCREENTEXT_HPP
#define RWENGINE_SCREENTEXT_HPP
#ifndef _RWENGINE_SCREENTEXT_HPP_
#define _RWENGINE_SCREENTEXT_HPP_
#include <algorithm>
#include <array>
#include <data/GameTexts.hpp>
#include <rw/types.hpp>
#include <utility>
#include <cstddef>
#include <string>
#include <vector>
#include <glm/glm.hpp>
#include <data/GameTexts.hpp>
enum class ScreenTextType {
/// Big text will be rendered according to the proscribed style.
/// Adding a 2nd big text will cause the first to terminate.

View File

@ -1,13 +1,17 @@
#include <ai/CharacterController.hpp>
#include <engine/Animator.hpp>
#include <engine/GameData.hpp>
#include <engine/GameState.hpp>
#include <engine/GameWorld.hpp>
#include <objects/CharacterObject.hpp>
#include <objects/VehicleObject.hpp>
#include <rw/defines.hpp>
#include "loaders/LoaderIFP.hpp"
#include <algorithm>
#include <btBulletDynamicsCommon.h>
// Required for BT_BULLET_VERSION
#include "LinearMath/btScalar.h"
#ifndef BT_BULLET_VERSION

View File

@ -1,8 +1,11 @@
#pragma once
#ifndef _RWENGINE_OBJECTTYPES_
#define _RWENGINE_OBJECTTYPES_
#include <cstdint>
/**
* all wordly GameObjects are associated with a 32-bit identifier
*/
typedef uint32_t GameObjectID;
typedef uint32_t GameObjectID;
#endif

View File

@ -1,7 +1,10 @@
#include "objects/PickupObject.hpp"
#include <btBulletDynamicsCommon.h>
#include <engine/GameData.hpp>
#include <engine/GameWorld.hpp>
#include <objects/CharacterObject.hpp>
#include <objects/PickupObject.hpp>
uint32_t colours[14] = {
0xff0000, // bat, detonator, adrenaline

View File

@ -1,3 +1,8 @@
#include "objects/VehicleObject.hpp"
#include <btBulletDynamicsCommon.h>
#include <glm/gtx/quaternion.hpp>
#include <BulletDynamics/Vehicle/btRaycastVehicle.h>
#include <data/Clump.hpp>
#include <data/CollisionModel.hpp>
@ -7,7 +12,6 @@
#include <engine/GameData.hpp>
#include <engine/GameWorld.hpp>
#include <objects/CharacterObject.hpp>
#include <objects/VehicleObject.hpp>
#define PART_CLOSE_VELOCITY 0.25f
constexpr float kVehicleMaxExitVelocity = 0.15f;

View File

@ -7,6 +7,8 @@
#include "SDL.h"
#include <iostream>
// Use first 8 chars of git hash as the build string
const std::string kBuildStr(kGitSHA1Hash, 8);
const std::string kWindowTitle = "RWGame";

View File

@ -1,4 +1,7 @@
#include "RWGame.hpp"
#include <glm/gtx/norm.hpp>
#include "DrawUI.hpp"
#include "GameInput.hpp"
#include "State.hpp"

View File

@ -18,6 +18,7 @@
#include <script/ScriptMachine.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtx/norm.hpp>
#include <glm/gtx/matrix_major_storage.hpp>
constexpr float kAutoLookTime = 2.f;

View File

@ -1,6 +1,7 @@
#include <boost/test/unit_test.hpp>
#include <data/Clump.hpp>
#include <engine/Animator.hpp>
#include <loaders/LoaderIFP.hpp>
#include <glm/gtx/string_cast.hpp>
#include "test_Globals.hpp"

View File

@ -1,6 +1,7 @@
#ifndef _TESTGLOBALS_HPP_
#define _TESTGLOBALS_HPP_
#include <btBulletDynamicsCommon.h>
#include <SDL2/SDL.h>
#include <GameWindow.hpp>
#include <boost/test/unit_test.hpp>

View File

@ -1,5 +1,6 @@
#include <boost/test/unit_test.hpp>
#include <data/ModelData.hpp>
#include <loaders/LoaderIDE.hpp>
#include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(ObjectDataTests)