mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
formatting, cleanups
This commit is contained in:
parent
5cc038e1c6
commit
8cb5717b86
3 changed files with 14 additions and 32 deletions
|
@ -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 QScriptValue& v) { return v; }
|
||||||
|
|
||||||
inline QScriptValue convertScriptValue(QScriptEngine* e, const QByteArray& 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();
|
QByteArray b64 = v.toBase64();
|
||||||
return QScriptValue(QString(b64));
|
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) {
|
inline QByteArray QByteArray_convertFromScriptValue(const QScriptValue& v, bool& isValid) {
|
||||||
isValid = true;
|
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();
|
QString b64 = v.toVariant().toString().trimmed();
|
||||||
|
|
||||||
return QByteArray::fromBase64(b64.toUtf8());
|
return QByteArray::fromBase64(b64.toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,7 @@ public:
|
||||||
Iterator<T>& operator=(const Iterator<T>& iterator) = default;
|
Iterator<T>& operator=(const Iterator<T>& iterator) = default;
|
||||||
Iterator<T>& operator=(T* ptr) {
|
Iterator<T>& operator=(T* ptr) {
|
||||||
_ptr = ptr;
|
_ptr = ptr;
|
||||||
// stride is left unchanged
|
// stride is left unchanged
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,42 +257,42 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<T>& operator+=(const Index& movement) {
|
Iterator<T>& operator+=(const Index& movement) {
|
||||||
movePtr(movement);
|
movePtr(movement);
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
Iterator<T>& operator-=(const Index& movement) {
|
Iterator<T>& operator-=(const Index& movement) {
|
||||||
movePtr(-movement);
|
movePtr(-movement);
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
Iterator<T>& operator++() {
|
Iterator<T>& operator++() {
|
||||||
movePtr(1);
|
movePtr(1);
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
Iterator<T>& operator--() {
|
Iterator<T>& operator--() {
|
||||||
movePtr(-1);
|
movePtr(-1);
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
Iterator<T> operator++(Index) {
|
Iterator<T> operator++(Index) {
|
||||||
auto temp(*this);
|
auto temp(*this);
|
||||||
movePtr(1);
|
movePtr(1);
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
Iterator<T> operator--(Index) {
|
Iterator<T> operator--(Index) {
|
||||||
auto temp(*this);
|
auto temp(*this);
|
||||||
movePtr(-1);
|
movePtr(-1);
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
Iterator<T> operator+(const Index& movement) {
|
Iterator<T> operator+(const Index& movement) {
|
||||||
auto oldPtr = _ptr;
|
auto oldPtr = _ptr;
|
||||||
movePtr(movement);
|
movePtr(movement);
|
||||||
auto temp(*this);
|
auto temp(*this);
|
||||||
_ptr = oldPtr;
|
_ptr = oldPtr;
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
Iterator<T> operator-(const Index& movement) {
|
Iterator<T> operator-(const Index& movement) {
|
||||||
auto oldPtr = _ptr;
|
auto oldPtr = _ptr;
|
||||||
movePtr(-movement);
|
movePtr(-movement);
|
||||||
auto temp(*this);
|
auto temp(*this);
|
||||||
_ptr = oldPtr;
|
_ptr = oldPtr;
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
// Attribute Buffers
|
// Attribute Buffers
|
||||||
int getNumAttributes() const { return _attributeBuffers.size(); }
|
int getNumAttributes() const { return _attributeBuffers.size(); }
|
||||||
void addAttribute(Slot slot, const BufferView& buffer);
|
void addAttribute(Slot slot, const BufferView& buffer);
|
||||||
const BufferView getAttributeBuffer(int attrib) const;
|
const BufferView getAttributeBuffer(int attrib) const;
|
||||||
|
|
||||||
// Stream format
|
// Stream format
|
||||||
const gpu::Stream::FormatPointer getVertexFormat() const { return _vertexFormat; }
|
const gpu::Stream::FormatPointer getVertexFormat() const { return _vertexFormat; }
|
||||||
|
|
Loading…
Reference in a new issue