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

Fix compilation under clang, fix majority of warnings

This commit is contained in:
Daniel Evans 2014-08-11 17:58:43 +01:00
parent 97fee9b4a8
commit b1c82e3582
17 changed files with 23 additions and 60 deletions

View File

@ -5,7 +5,6 @@
#include <glm/gtc/quaternion.hpp>
#include <data/PathData.hpp>
struct InstanceObject;
struct AIGraphNode;
class AIGraph

View File

@ -5,8 +5,8 @@
#include <glm/gtc/quaternion.hpp>
#include <string>
struct CharacterObject;
struct VehicleObject;
class CharacterObject;
class VehicleObject;
/**
* @class CharacterController

View File

@ -7,8 +7,8 @@
#include <string>
class GameObject;
class DynamicObjectData;
class VehicleHandlingInfo;
struct DynamicObjectData;
struct VehicleHandlingInfo;
/**
* @brief Utility object for managing bullet objects.

View File

@ -7,7 +7,7 @@
#include <vector>
class PlayerController;
class CutsceneData;
struct CutsceneData;
struct TextDisplayData
{

View File

@ -17,7 +17,7 @@ class CharacterObject;
class InstanceObject;
class VehicleObject;
class WeaponScan;
struct WeaponScan;
class ScriptMachine;

View File

@ -18,7 +18,7 @@
#define WATER_BUOYANCY_K 25000.f
#define WATER_BUOYANCY_C 2550.f
class Animation;
struct Animation;
typedef std::map<std::string, Animation*> AnimationSet;

View File

@ -41,7 +41,7 @@ struct AnimationGroup
* @brief The CharacterObject struct
* Implements Character object behaviours.
*/
struct CharacterObject : public GameObject
class CharacterObject : public GameObject
{
private:
VehicleObject* currentVehicle;

View File

@ -10,8 +10,9 @@ class CollisionInstance;
* @struct InstanceObject
* A simple object instance
*/
struct InstanceObject : public GameObject
class InstanceObject : public GameObject
{
public:
glm::vec3 scale;
CollisionInstance* body;
std::shared_ptr<ObjectData> object;

View File

@ -6,7 +6,7 @@
#include <memory>
#include <glm/glm.hpp>
class VehicleData;
struct VehicleData;
/**
* @brief Stores data loaded from handling.cfg

View File

@ -10,32 +10,13 @@
* @class VehicleObject
* Implements Vehicle behaviours.
*/
struct VehicleObject : public GameObject
class VehicleObject : public GameObject
{
public:
enum /*DamageFlags*/ {
DF_Bonnet = 1,
DF_Door_lf = 2,
DF_Door_rf = 4,
DF_Door_lr = 8,
DF_Door_rr = 16,
DF_Boot = 32,
DF_Windscreen = 64,
DF_Bump_front = 128,
DF_Bump_rear = 256,
DF_Wing_lf = 512,
DF_Wing_rf = 1024,
DF_Wing_lr = 2048,
DF_Wing_rr = 4096,
};
private:
float steerAngle;
float throttle;
float brake;
bool handbrake;
unsigned int damageFlags;
public:
VehicleDataHandle vehicle;

View File

@ -23,7 +23,7 @@ public:
};
SCMFile()
: _data(nullptr), _target(NoTarget), mainOffset(0),
: _data(nullptr), _target(NoTarget),
mainSize(0), missionLargestSize(0)
{}
@ -63,7 +63,6 @@ private:
std::vector<std::string> models;
uint32 mainOffset;
std::vector<unsigned int> missionOffsets;
uint32 mainSize;

View File

@ -7,7 +7,7 @@
#include <functional>
class ScriptMachine;
class SCMThread;
struct SCMThread;
typedef uint16_t SCMOpcode;
typedef char SCMByte;

View File

@ -10,7 +10,7 @@
VehicleObject::VehicleObject(GameWorld* engine, const glm::vec3& pos, const glm::quat& rot, ModelHandle* model, VehicleDataHandle data, VehicleInfoHandle info, const glm::vec3& prim, const glm::vec3& sec)
: GameObject(engine, pos, rot, model),
steerAngle(0.f), throttle(0.f), brake(0.f), handbrake(false),
damageFlags(0), vehicle(data), info(info), colourPrimary(prim),
vehicle(data), info(info), colourPrimary(prim),
colourSecondary(sec), collision(nullptr), physBody(nullptr), physVehicle(nullptr)
{
mHealth = 1000.f;
@ -424,24 +424,6 @@ void VehicleObject::setFrameState(ModelFrame* f, FrameState state)
}
}
unsigned int nameToDamageFlag(const std::string& name)
{
if(name.find("bonnet") != name.npos) return VehicleObject::DF_Bonnet;
if(name.find("door_lf") != name.npos) return VehicleObject::DF_Door_lf;
if(name.find("door_rf") != name.npos) return VehicleObject::DF_Door_rf;
if(name.find("door_lr") != name.npos) return VehicleObject::DF_Door_lr;
if(name.find("door_rr") != name.npos) return VehicleObject::DF_Door_rr;
if(name.find("boot") != name.npos) return VehicleObject::DF_Boot;
if(name.find("windscreen") != name.npos) return VehicleObject::DF_Windscreen;
if(name.find("bump_front") != name.npos) return VehicleObject::DF_Bump_front;
if(name.find("bump_rear") != name.npos) return VehicleObject::DF_Bump_rear;
if(name.find("wing_lf") != name.npos) return VehicleObject::DF_Wing_lf;
if(name.find("wing_rf") != name.npos) return VehicleObject::DF_Wing_rf;
if(name.find("wing_lr") != name.npos) return VehicleObject::DF_Wing_lr;
if(name.find("wing_rr") != name.npos) return VehicleObject::DF_Wing_rr;
return 0;
}
void VehicleObject::applyWaterFloat(const glm::vec3 &relPt)
{
auto ws = getPosition() + relPt;

View File

@ -247,7 +247,8 @@ GameRenderer::GameRenderer(GameWorld* engine)
float R = 1.f/(float)(rows-1);
float S = 1.f/(float)(segments-1);
glm::vec3 skydomeBuff[rows * segments];
std::vector<glm::vec3> skydomeBuff;
skydomeBuff.resize(rows * segments);
for( size_t r = 0, i = 0; r < rows; ++r) {
for( size_t s = 0; s < segments; ++s) {
skydomeBuff[i++] = glm::vec3(
@ -257,7 +258,7 @@ GameRenderer::GameRenderer(GameWorld* engine)
);
}
}
glBufferData(GL_ARRAY_BUFFER, sizeof(skydomeBuff), skydomeBuff, GL_STATIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, sizeof(skydomeBuff), skydomeBuff.data(), GL_STATIC_DRAW);
glGenBuffers(1, &skydomeIBO);
GLushort skydomeIndBuff[rows*segments*6];

View File

@ -44,7 +44,7 @@ void ScriptMachine::executeThread(SCMThread &t, int msPassed)
t.programCounter += sizeof(SCMByte);
}
parameters.push_back(SCMOpcodeParameter { type, 0 });
parameters.push_back(SCMOpcodeParameter { type, { 0 } });
switch(type) {
case EndOfArgList:
hasExtraParameters = false;

View File

@ -1,4 +1,4 @@
#ifndef LOADINGSTATE_HHP
#ifndef LOADINGSTATE_HPP
#define LOADINGSTATE_HPP
#include "State.hpp"
@ -18,4 +18,4 @@ public:
virtual void handleEvent(const sf::Event& event);
};
#endif // MENUSTATE_HPP
#endif // LOADINGSTATE_HPP

View File

@ -21,8 +21,8 @@ struct print_log_value<glm::vec3> {
namespace boost { namespace test_tools {
template<>
struct print_log_value<nullptr_t> {
void operator()( std::ostream& s , nullptr_t )
struct print_log_value<std::nullptr_t> {
void operator()( std::ostream& s , std::nullptr_t )
{
s << "nullptr";
}