cleaning code for review

This commit is contained in:
Sam Gateau 2015-03-20 11:55:00 -07:00
parent 885bff1225
commit fdbf4e5288
3 changed files with 25 additions and 25 deletions

View file

@ -41,18 +41,18 @@ public:
Language _lang = GLSL; Language _lang = GLSL;
}; };
static const uint32 INVALID_LOCATION = -1; static const int32 INVALID_LOCATION = -1;
class Slot { class Slot {
public: public:
std::string _name = (""); std::string _name;
int32 _location = INVALID_LOCATION; int32 _location{INVALID_LOCATION};
Element _element = Element(); Element _element;
uint16 _resourceType = Resource::BUFFER; uint16 _resourceType{Resource::BUFFER};
Slot(const Slot& s) : _name(s._name), _location(s._location), _element(s._element), _resourceType(s._resourceType) {} Slot(const Slot& s) : _name(s._name), _location(s._location), _element(s._element), _resourceType(s._resourceType) {}
Slot(const Slot&& s) : _name(s._name), _location(s._location), _element(s._element), _resourceType(s._resourceType) {} Slot(Slot&& s) : _name(s._name), _location(s._location), _element(s._element), _resourceType(s._resourceType) {}
Slot(const std::string& name, int32 location, const Element& element, uint16 resourceType = Resource::BUFFER) : Slot(const std::string& name, int32 location, const Element& element, uint16 resourceType = Resource::BUFFER) :
_name(name), _location(location), _element(element), _resourceType(resourceType) {} _name(name), _location(location), _element(element), _resourceType(resourceType) {}
Slot(const std::string& name) : _name(name) {} Slot(const std::string& name) : _name(name) {}
@ -79,13 +79,13 @@ public:
class SlotSet : public std::set<Slot, Less<Slot>> { class SlotSet : public std::set<Slot, Less<Slot>> {
public: public:
const Slot&& findSlot(const std::string& name) const { Slot findSlot(const std::string& name) const {
auto key = Slot(name); auto key = Slot(name);
auto found = static_cast<const std::set<Slot, Less<Slot>>*>(this)->find(key); auto found = static_cast<const std::set<Slot, Less<Slot>>*>(this)->find(key);
if (found != end()) { if (found != end()) {
return std::move((*found)); return (*found);
} }
return std::move(key); return key;
} }
int32 findLocation(const std::string& name) const { int32 findLocation(const std::string& name) const {
return findSlot(name)._location; return findSlot(name)._location;

View file

@ -252,16 +252,16 @@ public:
// Schema to access the attribute values of the light // Schema to access the attribute values of the light
class Schema { class Schema {
public: public:
Vec4 _position = Vec4(0.0f, 0.0f, 0.0f, 1.0f); Vec4 _position{0.0f, 0.0f, 0.0f, 1.0f};
Vec3 _direction = Vec3(0.0f, 0.0f, -1.0f); Vec3 _direction{0.0f, 0.0f, -1.0f};
float _spare0 = 0.0f; float _spare0{0.0f};
Color _color = Color(1.0f); Color _color{1.0f};
float _intensity = 1.0f; float _intensity{1.0f};
Vec4 _attenuation = Vec4(1.0f); Vec4 _attenuation{1.0f};
Vec4 _spot = Vec4(0.0f, 0.0f, 0.0f, 3.0f); Vec4 _spot{0.0f, 0.0f, 0.0f, 3.0f};
Vec4 _shadow = Vec4(0.0f); Vec4 _shadow{0.0f};
Vec4 _control = Vec4(0.0f); Vec4 _control{0.0f};
Schema() {} Schema() {}
}; };

View file

@ -79,13 +79,13 @@ public:
class Schema { class Schema {
public: public:
Color _diffuse = Color(0.5f); Color _diffuse{0.5f};
float _opacity = 1.f; float _opacity{1.f};
Color _specular = Color(0.03f); Color _specular{0.03f};
float _shininess = 0.1f; float _shininess{0.1f};
Color _emissive = Color(0.0f); Color _emissive{0.0f};
float _spare0 = 0.0f; float _spare0{0.0f};
glm::vec4 _spareVec4 = glm::vec4(0.0f); // for alignment beauty, Mat size == Mat4x4 glm::vec4 _spareVec4{0.0f}; // for alignment beauty, Material size == Mat4x4
Schema() {} Schema() {}
}; };