formatting, cleanups

This commit is contained in:
Seth Alves 2015-05-27 15:16:15 -07:00
parent 5cc038e1c6
commit 8cb5717b86
3 changed files with 14 additions and 32 deletions

View file

@ -97,14 +97,6 @@ inline QScriptValue convertScriptValue(QScriptEngine* e, const glm::quat& v) { r
inline QScriptValue convertScriptValue(QScriptEngine* e, const QScriptValue& v) { return v; }
inline QScriptValue convertScriptValue(QScriptEngine* e, const QByteArray& v) {
// return QScriptValue(QLatin1String(v.data()));
// QScriptValue array = e->newArray(v.size());
// for (int i = 0; i < v.size(); ++i) {
// array.setProperty(i, QScriptValue(e, (unsigned int) v[i]));
// }
// return array;
QByteArray b64 = v.toBase64();
return QScriptValue(QString(b64));
}
@ -149,17 +141,7 @@ inline QUuid QUuid_convertFromScriptValue(const QScriptValue& v, bool& isValid)
inline QByteArray QByteArray_convertFromScriptValue(const QScriptValue& v, bool& isValid) {
isValid = true;
// return v.toVariant().toByteArray();
// QByteArray byteArray;
// uint len = v.property("length").toUInt32();
// byteArray.resize(len);
// for (uint i = 0; i < len; ++i)
// byteArray[i] = v.property(i).toUInt32();
// return byteArray;
QString b64 = v.toVariant().toString().trimmed();
return QByteArray::fromBase64(b64.toUtf8());
}

View file

@ -235,7 +235,7 @@ public:
Iterator<T>& operator=(const Iterator<T>& iterator) = default;
Iterator<T>& operator=(T* ptr) {
_ptr = ptr;
// stride is left unchanged
// stride is left unchanged
return (*this);
}
@ -257,42 +257,42 @@ public:
}
Iterator<T>& operator+=(const Index& movement) {
movePtr(movement);
movePtr(movement);
return (*this);
}
Iterator<T>& operator-=(const Index& movement) {
movePtr(-movement);
movePtr(-movement);
return (*this);
}
Iterator<T>& operator++() {
movePtr(1);
movePtr(1);
return (*this);
}
Iterator<T>& operator--() {
movePtr(-1);
return (*this);
movePtr(-1);
return (*this);
}
Iterator<T> operator++(Index) {
auto temp(*this);
movePtr(1);
return temp;
movePtr(1);
return temp;
}
Iterator<T> operator--(Index) {
auto temp(*this);
movePtr(-1);
return temp;
movePtr(-1);
return temp;
}
Iterator<T> operator+(const Index& movement) {
auto oldPtr = _ptr;
movePtr(movement);
movePtr(movement);
auto temp(*this);
_ptr = oldPtr;
return temp;
}
Iterator<T> operator-(const Index& movement) {
auto oldPtr = _ptr;
movePtr(-movement);
auto temp(*this);
movePtr(-movement);
auto temp(*this);
_ptr = oldPtr;
return temp;
}

View file

@ -52,7 +52,7 @@ public:
// Attribute Buffers
int getNumAttributes() const { return _attributeBuffers.size(); }
void addAttribute(Slot slot, const BufferView& buffer);
const BufferView getAttributeBuffer(int attrib) const;
const BufferView getAttributeBuffer(int attrib) const;
// Stream format
const gpu::Stream::FormatPointer getVertexFormat() const { return _vertexFormat; }