Browse Source

Geometry: unsigned to signed

1vanK 3 years ago
parent
commit
b9d4ecdec8

+ 30 - 30
Source/Urho3D/AngelScript/Generated_Members.h

@@ -9954,11 +9954,11 @@ template <class T> void RegisterMembers_Geometry(asIScriptEngine* engine, const
 
     // float Geometry::GetHitDistance(const Ray& ray, Vector3* outNormal = nullptr, Vector2* outUV = nullptr) const
     // Error: type "Vector3*" can not automatically bind
-    // void Geometry::GetRawData(const unsigned char*& vertexData, unsigned& vertexSize, const unsigned char*& indexData, unsigned& indexSize, const Vector<VertexElement>*& elements) const
+    // void Geometry::GetRawData(const unsigned char*& vertexData, i32& vertexSize, const unsigned char*& indexData, i32& indexSize, const Vector<VertexElement>*& elements) const
     // Error: type "const unsigned char*&" can not automatically bind
-    // void Geometry::GetRawDataShared(SharedArrayPtr<unsigned char>& vertexData, unsigned& vertexSize, SharedArrayPtr<unsigned char>& indexData, unsigned& indexSize, const Vector<VertexElement>*& elements) const
+    // void Geometry::GetRawDataShared(SharedArrayPtr<unsigned char>& vertexData, i32& vertexSize, SharedArrayPtr<unsigned char>& indexData, i32& indexSize, const Vector<VertexElement>*& elements) const
     // Error: type "SharedArrayPtr<unsigned char>&" can not automatically bind
-    // void Geometry::SetRawIndexData(const SharedArrayPtr<unsigned char>& data, unsigned indexSize)
+    // void Geometry::SetRawIndexData(const SharedArrayPtr<unsigned char>& data, i32 indexSize)
     // Error: type "const SharedArrayPtr<unsigned char>&" can not automatically bind
     // void Geometry::SetRawVertexData(const SharedArrayPtr<unsigned char>& data, const Vector<VertexElement>& elements)
     // Error: type "const SharedArrayPtr<unsigned char>&" can not automatically bind
@@ -9975,40 +9975,40 @@ template <class T> void RegisterMembers_Geometry(asIScriptEngine* engine, const
     engine->RegisterObjectMethod(className, "IndexBuffer@+ GetIndexBuffer() const", AS_METHODPR(T, GetIndexBuffer, () const, IndexBuffer*), AS_CALL_THISCALL);
     engine->RegisterObjectMethod(className, "IndexBuffer@+ get_indexBuffer() const", AS_METHODPR(T, GetIndexBuffer, () const, IndexBuffer*), AS_CALL_THISCALL);
 
-    // unsigned Geometry::GetIndexCount() const
-    engine->RegisterObjectMethod(className, "uint GetIndexCount() const", AS_METHODPR(T, GetIndexCount, () const, unsigned), AS_CALL_THISCALL);
-    engine->RegisterObjectMethod(className, "uint get_indexCount() const", AS_METHODPR(T, GetIndexCount, () const, unsigned), AS_CALL_THISCALL);
+    // i32 Geometry::GetIndexCount() const
+    engine->RegisterObjectMethod(className, "int GetIndexCount() const", AS_METHODPR(T, GetIndexCount, () const, i32), AS_CALL_THISCALL);
+    engine->RegisterObjectMethod(className, "int get_indexCount() const", AS_METHODPR(T, GetIndexCount, () const, i32), AS_CALL_THISCALL);
 
-    // unsigned Geometry::GetIndexStart() const
-    engine->RegisterObjectMethod(className, "uint GetIndexStart() const", AS_METHODPR(T, GetIndexStart, () const, unsigned), AS_CALL_THISCALL);
-    engine->RegisterObjectMethod(className, "uint get_indexStart() const", AS_METHODPR(T, GetIndexStart, () const, unsigned), AS_CALL_THISCALL);
+    // i32 Geometry::GetIndexStart() const
+    engine->RegisterObjectMethod(className, "int GetIndexStart() const", AS_METHODPR(T, GetIndexStart, () const, i32), AS_CALL_THISCALL);
+    engine->RegisterObjectMethod(className, "int get_indexStart() const", AS_METHODPR(T, GetIndexStart, () const, i32), AS_CALL_THISCALL);
 
     // float Geometry::GetLodDistance() const
     engine->RegisterObjectMethod(className, "float GetLodDistance() const", AS_METHODPR(T, GetLodDistance, () const, float), AS_CALL_THISCALL);
     engine->RegisterObjectMethod(className, "float get_lodDistance() const", AS_METHODPR(T, GetLodDistance, () const, float), AS_CALL_THISCALL);
 
-    // unsigned Geometry::GetNumVertexBuffers() const
-    engine->RegisterObjectMethod(className, "uint GetNumVertexBuffers() const", AS_METHODPR(T, GetNumVertexBuffers, () const, unsigned), AS_CALL_THISCALL);
-    engine->RegisterObjectMethod(className, "uint get_numVertexBuffers() const", AS_METHODPR(T, GetNumVertexBuffers, () const, unsigned), AS_CALL_THISCALL);
+    // i32 Geometry::GetNumVertexBuffers() const
+    engine->RegisterObjectMethod(className, "int GetNumVertexBuffers() const", AS_METHODPR(T, GetNumVertexBuffers, () const, i32), AS_CALL_THISCALL);
+    engine->RegisterObjectMethod(className, "int get_numVertexBuffers() const", AS_METHODPR(T, GetNumVertexBuffers, () const, i32), AS_CALL_THISCALL);
 
     // PrimitiveType Geometry::GetPrimitiveType() const
     engine->RegisterObjectMethod(className, "PrimitiveType GetPrimitiveType() const", AS_METHODPR(T, GetPrimitiveType, () const, PrimitiveType), AS_CALL_THISCALL);
     engine->RegisterObjectMethod(className, "PrimitiveType get_primitiveType() const", AS_METHODPR(T, GetPrimitiveType, () const, PrimitiveType), AS_CALL_THISCALL);
 
-    // VertexBuffer* Geometry::GetVertexBuffer(unsigned index) const
-    engine->RegisterObjectMethod(className, "VertexBuffer@+ GetVertexBuffer(uint) const", AS_METHODPR(T, GetVertexBuffer, (unsigned) const, VertexBuffer*), AS_CALL_THISCALL);
-    engine->RegisterObjectMethod(className, "VertexBuffer@+ get_vertexBuffers(uint) const", AS_METHODPR(T, GetVertexBuffer, (unsigned) const, VertexBuffer*), AS_CALL_THISCALL);
+    // VertexBuffer* Geometry::GetVertexBuffer(i32 index) const
+    engine->RegisterObjectMethod(className, "VertexBuffer@+ GetVertexBuffer(int) const", AS_METHODPR(T, GetVertexBuffer, (i32) const, VertexBuffer*), AS_CALL_THISCALL);
+    engine->RegisterObjectMethod(className, "VertexBuffer@+ get_vertexBuffers(int) const", AS_METHODPR(T, GetVertexBuffer, (i32) const, VertexBuffer*), AS_CALL_THISCALL);
 
     // const Vector<SharedPtr<VertexBuffer>>& Geometry::GetVertexBuffers() const
     engine->RegisterObjectMethod(className, "Array<VertexBuffer@>@ GetVertexBuffers() const", AS_FUNCTION_OBJFIRST(Geometry_constspVectorlesSharedPtrlesVertexBuffergregreamp_GetVertexBuffers_void_template<Geometry>), AS_CALL_CDECL_OBJFIRST);
 
-    // unsigned Geometry::GetVertexCount() const
-    engine->RegisterObjectMethod(className, "uint GetVertexCount() const", AS_METHODPR(T, GetVertexCount, () const, unsigned), AS_CALL_THISCALL);
-    engine->RegisterObjectMethod(className, "uint get_vertexCount() const", AS_METHODPR(T, GetVertexCount, () const, unsigned), AS_CALL_THISCALL);
+    // i32 Geometry::GetVertexCount() const
+    engine->RegisterObjectMethod(className, "int GetVertexCount() const", AS_METHODPR(T, GetVertexCount, () const, i32), AS_CALL_THISCALL);
+    engine->RegisterObjectMethod(className, "int get_vertexCount() const", AS_METHODPR(T, GetVertexCount, () const, i32), AS_CALL_THISCALL);
 
-    // unsigned Geometry::GetVertexStart() const
-    engine->RegisterObjectMethod(className, "uint GetVertexStart() const", AS_METHODPR(T, GetVertexStart, () const, unsigned), AS_CALL_THISCALL);
-    engine->RegisterObjectMethod(className, "uint get_vertexStart() const", AS_METHODPR(T, GetVertexStart, () const, unsigned), AS_CALL_THISCALL);
+    // i32 Geometry::GetVertexStart() const
+    engine->RegisterObjectMethod(className, "int GetVertexStart() const", AS_METHODPR(T, GetVertexStart, () const, i32), AS_CALL_THISCALL);
+    engine->RegisterObjectMethod(className, "int get_vertexStart() const", AS_METHODPR(T, GetVertexStart, () const, i32), AS_CALL_THISCALL);
 
     // bool Geometry::IsEmpty() const
     engine->RegisterObjectMethod(className, "bool IsEmpty() const", AS_METHODPR(T, IsEmpty, () const, bool), AS_CALL_THISCALL);
@@ -10017,11 +10017,11 @@ template <class T> void RegisterMembers_Geometry(asIScriptEngine* engine, const
     // bool Geometry::IsInside(const Ray& ray) const
     engine->RegisterObjectMethod(className, "bool IsInside(const Ray&in) const", AS_METHODPR(T, IsInside, (const Ray&) const, bool), AS_CALL_THISCALL);
 
-    // bool Geometry::SetDrawRange(PrimitiveType type, unsigned indexStart, unsigned indexCount, bool getUsedVertexRange = true)
-    engine->RegisterObjectMethod(className, "bool SetDrawRange(PrimitiveType, uint, uint, bool = true)", AS_METHODPR(T, SetDrawRange, (PrimitiveType, unsigned, unsigned, bool), bool), AS_CALL_THISCALL);
+    // bool Geometry::SetDrawRange(PrimitiveType type, i32 indexStart, i32 indexCount, bool getUsedVertexRange = true)
+    engine->RegisterObjectMethod(className, "bool SetDrawRange(PrimitiveType, int, int, bool = true)", AS_METHODPR(T, SetDrawRange, (PrimitiveType, i32, i32, bool), bool), AS_CALL_THISCALL);
 
-    // bool Geometry::SetDrawRange(PrimitiveType type, unsigned indexStart, unsigned indexCount, unsigned vertexStart, unsigned vertexCount, bool checkIllegal = true)
-    engine->RegisterObjectMethod(className, "bool SetDrawRange(PrimitiveType, uint, uint, uint, uint, bool = true)", AS_METHODPR(T, SetDrawRange, (PrimitiveType, unsigned, unsigned, unsigned, unsigned, bool), bool), AS_CALL_THISCALL);
+    // bool Geometry::SetDrawRange(PrimitiveType type, i32 indexStart, i32 indexCount, i32 vertexStart, i32 vertexCount, bool checkIllegal = true)
+    engine->RegisterObjectMethod(className, "bool SetDrawRange(PrimitiveType, int, int, int, int, bool = true)", AS_METHODPR(T, SetDrawRange, (PrimitiveType, i32, i32, i32, i32, bool), bool), AS_CALL_THISCALL);
 
     // void Geometry::SetIndexBuffer(IndexBuffer* buffer)
     engine->RegisterObjectMethod(className, "void SetIndexBuffer(IndexBuffer@+)", AS_METHODPR(T, SetIndexBuffer, (IndexBuffer*), void), AS_CALL_THISCALL);
@@ -10031,12 +10031,12 @@ template <class T> void RegisterMembers_Geometry(asIScriptEngine* engine, const
     engine->RegisterObjectMethod(className, "void SetLodDistance(float)", AS_METHODPR(T, SetLodDistance, (float), void), AS_CALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_lodDistance(float)", AS_METHODPR(T, SetLodDistance, (float), void), AS_CALL_THISCALL);
 
-    // bool Geometry::SetNumVertexBuffers(unsigned num)
-    engine->RegisterObjectMethod(className, "bool SetNumVertexBuffers(uint)", AS_METHODPR(T, SetNumVertexBuffers, (unsigned), bool), AS_CALL_THISCALL);
-    engine->RegisterObjectMethod(className, "bool set_numVertexBuffers(uint)", AS_METHODPR(T, SetNumVertexBuffers, (unsigned), bool), AS_CALL_THISCALL);
+    // bool Geometry::SetNumVertexBuffers(i32 num)
+    engine->RegisterObjectMethod(className, "bool SetNumVertexBuffers(int)", AS_METHODPR(T, SetNumVertexBuffers, (i32), bool), AS_CALL_THISCALL);
+    engine->RegisterObjectMethod(className, "bool set_numVertexBuffers(int)", AS_METHODPR(T, SetNumVertexBuffers, (i32), bool), AS_CALL_THISCALL);
 
-    // bool Geometry::SetVertexBuffer(unsigned index, VertexBuffer* buffer)
-    engine->RegisterObjectMethod(className, "bool SetVertexBuffer(uint, VertexBuffer@+)", AS_METHODPR(T, SetVertexBuffer, (unsigned, VertexBuffer*), bool), AS_CALL_THISCALL);
+    // bool Geometry::SetVertexBuffer(i32 index, VertexBuffer* buffer)
+    engine->RegisterObjectMethod(className, "bool SetVertexBuffer(int, VertexBuffer@+)", AS_METHODPR(T, SetVertexBuffer, (i32, VertexBuffer*), bool), AS_CALL_THISCALL);
 
     #ifdef REGISTER_MEMBERS_MANUAL_PART_Geometry
         REGISTER_MEMBERS_MANUAL_PART_Geometry();

+ 2 - 2
Source/Urho3D/Graphics/CustomGeometry.cpp

@@ -167,9 +167,9 @@ bool CustomGeometry::DrawOcclusion(OcclusionBuffer* buffer)
             buffer->SetCullMode(CULL_CCW);
 
         const unsigned char* vertexData;
-        unsigned vertexSize;
+        i32 vertexSize;
         const unsigned char* indexData;
-        unsigned indexSize;
+        i32 indexSize;
         const Vector<VertexElement>* elements;
 
         geometry->GetRawData(vertexData, vertexSize, indexData, indexSize, elements);

+ 2 - 2
Source/Urho3D/Graphics/DecalSet.cpp

@@ -683,10 +683,10 @@ void DecalSet::GetFaces(Vector<Vector<DecalVertex>>& faces, Drawable* target, un
     const unsigned char* normalData = nullptr;
     const unsigned char* skinningData = nullptr;
     const unsigned char* indexData = nullptr;
-    unsigned positionStride = 0;
+    i32 positionStride = 0;
     unsigned normalStride = 0;
     unsigned skinningStride = 0;
-    unsigned indexStride = 0;
+    i32 indexStride = 0;
 
     IndexBuffer* ib = geometry->GetIndexBuffer();
     if (ib)

+ 1 - 1
Source/Urho3D/Graphics/Drawable.cpp

@@ -442,7 +442,7 @@ bool WriteDrawablesToOBJ(const Vector<Drawable*>& drawables, File* outputFile, b
 
             const unsigned char* vertexData;
             const unsigned char* indexData;
-            unsigned elementSize, indexSize;
+            i32 elementSize, indexSize;
             const Vector<VertexElement>* elements;
             geo->GetRawData(vertexData, elementSize, indexData, indexSize, elements);
             if (!vertexData || !elements)

+ 31 - 17
Source/Urho3D/Graphics/Geometry.cpp

@@ -31,22 +31,26 @@ Geometry::Geometry(Context* context) :
 
 Geometry::~Geometry() = default;
 
-bool Geometry::SetNumVertexBuffers(unsigned num)
+bool Geometry::SetNumVertexBuffers(i32 num)
 {
+    assert(num >= 0);
+
     if (num >= MAX_VERTEX_STREAMS)
     {
         URHO3D_LOGERROR("Too many vertex streams");
         return false;
     }
 
-    unsigned oldSize = vertexBuffers_.Size();
+    i32 oldSize = vertexBuffers_.Size(); // TODO: unused
     vertexBuffers_.Resize(num);
 
     return true;
 }
 
-bool Geometry::SetVertexBuffer(unsigned index, VertexBuffer* buffer)
+bool Geometry::SetVertexBuffer(i32 index, VertexBuffer* buffer)
 {
+    assert(index >= 0);
+
     if (index >= vertexBuffers_.Size())
     {
         URHO3D_LOGERROR("Stream index out of bounds");
@@ -62,8 +66,11 @@ void Geometry::SetIndexBuffer(IndexBuffer* buffer)
     indexBuffer_ = buffer;
 }
 
-bool Geometry::SetDrawRange(PrimitiveType type, unsigned indexStart, unsigned indexCount, bool getUsedVertexRange)
+bool Geometry::SetDrawRange(PrimitiveType type, i32 indexStart, i32 indexCount, bool getUsedVertexRange/* = true*/)
 {
+    assert(indexStart >= 0);
+    assert(indexCount >= 0);
+
     if (!indexBuffer_ && !rawIndexData_)
     {
         URHO3D_LOGERROR("Null index buffer and no raw index data, can not define indexed draw range");
@@ -98,9 +105,14 @@ bool Geometry::SetDrawRange(PrimitiveType type, unsigned indexStart, unsigned in
     return true;
 }
 
-bool Geometry::SetDrawRange(PrimitiveType type, unsigned indexStart, unsigned indexCount, unsigned vertexStart, unsigned vertexCount,
+bool Geometry::SetDrawRange(PrimitiveType type, i32 indexStart, i32 indexCount, i32 vertexStart, i32 vertexCount,
     bool checkIllegal)
 {
+    assert(indexStart >= 0);
+    assert(indexCount >= 0);
+    assert(vertexStart >= 0);
+    assert(vertexCount >= 0);
+
     if (indexBuffer_)
     {
         // We can allow setting an illegal draw range now if the caller guarantees to resize / fill the buffer later
@@ -148,8 +160,9 @@ void Geometry::SetRawVertexData(const SharedArrayPtr<unsigned char>& data, unsig
     rawElements_ = VertexBuffer::GetElements(elementMask);
 }
 
-void Geometry::SetRawIndexData(const SharedArrayPtr<unsigned char>& data, unsigned indexSize)
+void Geometry::SetRawIndexData(const SharedArrayPtr<unsigned char>& data, i32 indexSize)
 {
+    assert(indexSize >= 0);
     rawIndexData_ = data;
     rawIndexSize_ = indexSize;
 }
@@ -169,8 +182,9 @@ void Geometry::Draw(Graphics* graphics)
     }
 }
 
-VertexBuffer* Geometry::GetVertexBuffer(unsigned index) const
+VertexBuffer* Geometry::GetVertexBuffer(i32 index) const
 {
+    assert(index >= 0);
     return index < vertexBuffers_.Size() ? vertexBuffers_[index] : nullptr;
 }
 
@@ -190,8 +204,8 @@ u16 Geometry::GetBufferHash() const
     return hash;
 }
 
-void Geometry::GetRawData(const unsigned char*& vertexData, unsigned& vertexSize, const unsigned char*& indexData,
-    unsigned& indexSize, const Vector<VertexElement>*& elements) const
+void Geometry::GetRawData(const unsigned char*& vertexData, i32& vertexSize, const unsigned char*& indexData,
+    i32& indexSize, const Vector<VertexElement>*& elements) const
 {
     if (rawVertexData_)
     {
@@ -235,8 +249,8 @@ void Geometry::GetRawData(const unsigned char*& vertexData, unsigned& vertexSize
     }
 }
 
-void Geometry::GetRawDataShared(SharedArrayPtr<unsigned char>& vertexData, unsigned& vertexSize,
-    SharedArrayPtr<unsigned char>& indexData, unsigned& indexSize, const Vector<VertexElement>*& elements) const
+void Geometry::GetRawDataShared(SharedArrayPtr<unsigned char>& vertexData, i32& vertexSize,
+    SharedArrayPtr<unsigned char>& indexData, i32& indexSize, const Vector<VertexElement>*& elements) const
 {
     if (rawVertexData_)
     {
@@ -284,8 +298,8 @@ float Geometry::GetHitDistance(const Ray& ray, Vector3* outNormal, Vector2* outU
 {
     const unsigned char* vertexData;
     const unsigned char* indexData;
-    unsigned vertexSize;
-    unsigned indexSize;
+    i32 vertexSize;
+    i32 indexSize;
     const Vector<VertexElement>* elements;
 
     GetRawData(vertexData, vertexSize, indexData, indexSize, elements);
@@ -293,9 +307,9 @@ float Geometry::GetHitDistance(const Ray& ray, Vector3* outNormal, Vector2* outU
     if (!vertexData || !elements || VertexBuffer::GetElementOffset(*elements, TYPE_VECTOR3, SEM_POSITION) != 0)
         return M_INFINITY;
 
-    unsigned uvOffset = VertexBuffer::GetElementOffset(*elements, TYPE_VECTOR2, SEM_TEXCOORD);
+    i32 uvOffset = VertexBuffer::GetElementOffset(*elements, TYPE_VECTOR2, SEM_TEXCOORD);
 
-    if (outUV && uvOffset == M_MAX_UNSIGNED)
+    if (outUV && uvOffset == NINDEX)
     {
         // requested UV output, but no texture data in vertex buffer
         URHO3D_LOGWARNING("Illegal GetHitDistance call: UV return requested on vertex buffer without UV coords");
@@ -311,8 +325,8 @@ bool Geometry::IsInside(const Ray& ray) const
 {
     const unsigned char* vertexData;
     const unsigned char* indexData;
-    unsigned vertexSize;
-    unsigned indexSize;
+    i32 vertexSize;
+    i32 indexSize;
     const Vector<VertexElement>* elements;
 
     GetRawData(vertexData, vertexSize, indexData, indexSize, elements);

+ 18 - 18
Source/Urho3D/Graphics/Geometry.h

@@ -28,16 +28,16 @@ public:
 
     /// Set number of vertex buffers.
     /// @property
-    bool SetNumVertexBuffers(unsigned num);
+    bool SetNumVertexBuffers(i32 num);
     /// Set a vertex buffer by index.
-    bool SetVertexBuffer(unsigned index, VertexBuffer* buffer);
+    bool SetVertexBuffer(i32 index, VertexBuffer* buffer);
     /// Set the index buffer.
     /// @property
     void SetIndexBuffer(IndexBuffer* buffer);
     /// Set the draw range.
-    bool SetDrawRange(PrimitiveType type, unsigned indexStart, unsigned indexCount, bool getUsedVertexRange = true);
+    bool SetDrawRange(PrimitiveType type, i32 indexStart, i32 indexCount, bool getUsedVertexRange = true);
     /// Set the draw range.
-    bool SetDrawRange(PrimitiveType type, unsigned indexStart, unsigned indexCount, unsigned vertexStart, unsigned vertexCount,
+    bool SetDrawRange(PrimitiveType type, i32 indexStart, i32 indexCount, i32 vertexStart, i32 vertexCount,
         bool checkIllegal = true);
     /// Set the LOD distance.
     /// @property
@@ -47,7 +47,7 @@ public:
     /// Override raw vertex data to be returned for CPU-side operations using a legacy vertex bitmask.
     void SetRawVertexData(const SharedArrayPtr<unsigned char>& data, unsigned elementMask);
     /// Override raw index data to be returned for CPU-side operations.
-    void SetRawIndexData(const SharedArrayPtr<unsigned char>& data, unsigned indexSize);
+    void SetRawIndexData(const SharedArrayPtr<unsigned char>& data, i32 indexSize);
     /// Draw.
     void Draw(Graphics* graphics);
 
@@ -56,11 +56,11 @@ public:
 
     /// Return number of vertex buffers.
     /// @property
-    unsigned GetNumVertexBuffers() const { return vertexBuffers_.Size(); }
+    i32 GetNumVertexBuffers() const { return vertexBuffers_.Size(); }
 
     /// Return vertex buffer by index.
     /// @property{get_vertexBuffers}
-    VertexBuffer* GetVertexBuffer(unsigned index) const;
+    VertexBuffer* GetVertexBuffer(i32 index) const;
 
     /// Return the index buffer.
     /// @property
@@ -72,19 +72,19 @@ public:
 
     /// Return start index.
     /// @property
-    unsigned GetIndexStart() const { return indexStart_; }
+    i32 GetIndexStart() const { return indexStart_; }
 
     /// Return number of indices.
     /// @property
-    unsigned GetIndexCount() const { return indexCount_; }
+    i32 GetIndexCount() const { return indexCount_; }
 
     /// Return first used vertex.
     /// @property
-    unsigned GetVertexStart() const { return vertexStart_; }
+    i32 GetVertexStart() const { return vertexStart_; }
 
     /// Return number of used vertices.
     /// @property
-    unsigned GetVertexCount() const { return vertexCount_; }
+    i32 GetVertexCount() const { return vertexCount_; }
 
     /// Return LOD distance.
     /// @property
@@ -93,10 +93,10 @@ public:
     /// Return buffers' combined hash value for state sorting.
     u16 GetBufferHash() const;
     /// Return raw vertex and index data for CPU operations, or null pointers if not available. Will return data of the first vertex buffer if override data not set.
-    void GetRawData(const unsigned char*& vertexData, unsigned& vertexSize, const unsigned char*& indexData, unsigned& indexSize, const Vector<VertexElement>*& elements) const;
+    void GetRawData(const unsigned char*& vertexData, i32& vertexSize, const unsigned char*& indexData, i32& indexSize, const Vector<VertexElement>*& elements) const;
     /// Return raw vertex and index data for CPU operations, or null pointers if not available. Will return data of the first vertex buffer if override data not set.
-    void GetRawDataShared(SharedArrayPtr<unsigned char>& vertexData, unsigned& vertexSize, SharedArrayPtr<unsigned char>& indexData,
-        unsigned& indexSize, const Vector<VertexElement>*& elements) const;
+    void GetRawDataShared(SharedArrayPtr<unsigned char>& vertexData, i32& vertexSize, SharedArrayPtr<unsigned char>& indexData,
+        i32& indexSize, const Vector<VertexElement>*& elements) const;
     /// Return ray hit distance or infinity if no hit. Requires raw data to be set. Optionally return hit normal and hit uv coordinates at intersect point.
     float GetHitDistance(const Ray& ray, Vector3* outNormal = nullptr, Vector2* outUV = nullptr) const;
     /// Return whether or not the ray is inside geometry.
@@ -114,9 +114,9 @@ private:
     /// Primitive type.
     PrimitiveType primitiveType_;
     /// Start index.
-    unsigned indexStart_;
+    i32 indexStart_;
     /// Number of indices.
-    unsigned indexCount_;
+    i32 indexCount_;
     /// First used vertex.
     i32 vertexStart_;
     /// Number of used vertices.
@@ -130,9 +130,9 @@ private:
     /// Raw index data override.
     SharedArrayPtr<unsigned char> rawIndexData_;
     /// Raw vertex data override size.
-    unsigned rawVertexSize_;
+    i32 rawVertexSize_;
     /// Raw index data override size.
-    unsigned rawIndexSize_;
+    i32 rawIndexSize_;
 };
 
 }

+ 2 - 2
Source/Urho3D/Graphics/StaticModel.cpp

@@ -190,9 +190,9 @@ bool StaticModel::DrawOcclusion(OcclusionBuffer* buffer)
             buffer->SetCullMode(CULL_CCW);
 
         const unsigned char* vertexData;
-        unsigned vertexSize;
+        i32 vertexSize;
         const unsigned char* indexData;
-        unsigned indexSize;
+        i32 indexSize;
         const Vector<VertexElement>* elements;
 
         geometry->GetRawData(vertexData, vertexSize, indexData, indexSize, elements);

+ 2 - 2
Source/Urho3D/Graphics/StaticModelGroup.cpp

@@ -229,9 +229,9 @@ bool StaticModelGroup::DrawOcclusion(OcclusionBuffer* buffer)
                 buffer->SetCullMode(CULL_CCW);
 
             const unsigned char* vertexData;
-            unsigned vertexSize;
+            i32 vertexSize;
             const unsigned char* indexData;
-            unsigned indexSize;
+            i32 indexSize;
             const Vector<VertexElement>* elements;
 
             geometry->GetRawData(vertexData, vertexSize, indexData, indexSize, elements);

+ 2 - 2
Source/Urho3D/Graphics/TerrainPatch.cpp

@@ -175,9 +175,9 @@ bool TerrainPatch::DrawOcclusion(OcclusionBuffer* buffer)
         buffer->SetCullMode(CULL_CCW);
 
     const unsigned char* vertexData;
-    unsigned vertexSize;
+    i32 vertexSize;
     const unsigned char* indexData;
-    unsigned indexSize;
+    i32 indexSize;
     const Vector<VertexElement>* elements;
 
     occlusionGeometry_->GetRawData(vertexData, vertexSize, indexData, indexSize, elements);

+ 2 - 2
Source/Urho3D/Navigation/NavigationMesh.cpp

@@ -1178,8 +1178,8 @@ void NavigationMesh::AddTriMeshGeometry(NavBuildData* build, Geometry* geometry,
 
     const unsigned char* vertexData;
     const unsigned char* indexData;
-    unsigned vertexSize;
-    unsigned indexSize;
+    i32 vertexSize;
+    i32 indexSize;
     const Vector<VertexElement>* elements;
 
     geometry->GetRawData(vertexData, vertexSize, indexData, indexSize, elements);

+ 4 - 4
Source/Urho3D/Physics/CollisionShape.cpp

@@ -88,8 +88,8 @@ public:
 
             SharedArrayPtr<unsigned char> vertexData;
             SharedArrayPtr<unsigned char> indexData;
-            unsigned vertexSize;
-            unsigned indexSize;
+            i32 vertexSize;
+            i32 indexSize;
             const Vector<VertexElement>* elements;
 
             geometry->GetRawDataShared(vertexData, vertexSize, indexData, indexSize, elements);
@@ -228,8 +228,8 @@ ConvexData::ConvexData(Model* model, i32 lodLevel)
 
         const unsigned char* vertexData;
         const unsigned char* indexData;
-        unsigned vertexSize;
-        unsigned indexSize;
+        i32 vertexSize;
+        i32 indexSize;
         const Vector<VertexElement>* elements;
 
         geometry->GetRawData(vertexData, vertexSize, indexData, indexSize, elements);