Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 270 vs 273 for /trunk/Source Code/Hardware/Video/Buffers/VertexBuffer/Headers/VertexBuffer.h

Diff revisions: vs.
  @@ -24,7 +24,6 @@
24 24 #define _VERTEX_BUFFER_OBJECT_H
25 25
26 26 #include <iostream>
27 - #include <cassert>
28 27 #include "Utility/Headers/Vector.h"
29 28 #include "Utility/Headers/GUIDWrapper.h"
30 29 #include "Core/Math/Headers/MathClasses.h"
  @@ -110,7 +109,10 @@
110 109 inline void setRangeCount(const U32 rangeCount) {_rangeCount = rangeCount;}
111 110 inline void setFirstElement(U32 firstElement) {_firstElement = firstElement;}
112 111 inline void setDepthPass(bool state = false) {if(_optimizeForDepth) _depthPass = state;}
113 - inline void useLargeIndices(bool state = true) {assert(!_created); _largeIndices = state; _format = _largeIndices ? UNSIGNED_INT : UNSIGNED_SHORT;}
112 + inline void useLargeIndices(bool state = true) {
113 + DIVIDE_ASSERT(!_created, "VertexBuffer error: Indice format type specified before buffer creation!");
114 + _largeIndices = state; _format = _largeIndices ? UNSIGNED_INT : UNSIGNED_SHORT;
115 + }
114 116 inline void computeTriangles(bool state = true) {_computeTriangles = state;}
115 117 inline void reservePositionCount(U32 size) {_dataPosition.reserve(size);}
116 118 inline void reserveColourCount(U32 size) {_dataColor.reserve(size);}
  @@ -259,38 +261,38 @@
259 261 }
260 262
261 263 inline void setIndiceLimits(const vec2<U32>& indiceLimits, U8 LODindex = 0) {
262 - assert(LODindex < _indiceLimits.size());
264 + DIVIDE_ASSERT(LODindex < _indiceLimits.size(), "VertexBuffer error: Invalid LOD passed for indices limits creation");
263 265 vec2<U32>& limits = _indiceLimits[LODindex];
264 266 limits.y = std::max(indiceLimits.y, limits.y);
265 267 limits.x = std::min(indiceLimits.x, limits.x);
266 268 }
267 269
268 270 inline void modifyPositionValue(U32 index, const vec3<F32>& newValue){
269 - assert(index < _dataPosition.size());
271 + DIVIDE_ASSERT(index < _dataPosition.size(), "VertexBuffer error: Invalid position offset!");
270 272 _dataPosition[index] = newValue;
271 273 _attribDirty[ATTRIB_POSITION] = true;
272 274 }
273 275
274 276 inline void modifyColorValue(U32 index, const vec3<U8>& newValue) {
275 - assert(index < _dataColor.size());
277 + DIVIDE_ASSERT(index < _dataColor.size(), "VertexBuffer error: Invalid color offset!");
276 278 _dataColor[index] = newValue;
277 279 _attribDirty[ATTRIB_COLOR] = true;
278 280 }
279 281
280 282 inline void modifyNormalValue(U32 index, const vec3<F32>& newValue) {
281 - assert(index < _dataNormal.size());
283 + DIVIDE_ASSERT(index < _dataNormal.size(), "VertexBuffer error: Invalid normal offset!");
282 284 _dataNormal[index] = newValue;
283 285 _attribDirty[ATTRIB_NORMAL] = true;
284 286 }
285 287
286 288 inline void modifyTangentValue(U32 index, const vec3<F32>& newValue) {
287 - assert(index < _dataTangent.size());
289 + DIVIDE_ASSERT(index < _dataTangent.size(), "VertexBuffer error: Invalid tangent offset!");
288 290 _dataTangent[index] = newValue;
289 291 _attribDirty[ATTRIB_TANGENT] = true;
290 292 }
291 293
292 294 inline void modifyBiTangentValue(U32 index, const vec3<F32>& newValue) {
293 - assert(index < _dataBiTangent.size());
295 + DIVIDE_ASSERT(index < _dataBiTangent.size(), "VertexBuffer error: Invalid bitangent offset!");
294 296 _dataBiTangent[index] = newValue;
295 297 _attribDirty[ATTRIB_BITANGENT] = true;
296 298 }
  @@ -306,12 +308,12 @@
306 308 }
307 309
308 310 inline U32 getPartitionCount(U16 partitionIdx){
309 - assert(partitionIdx < _partitions.size());
311 + DIVIDE_ASSERT(partitionIdx < _partitions.size(), "VertexBuffer error: Invalid partition offset!");
310 312 return _partitions[partitionIdx].second;
311 313 }
312 314
313 315 inline U32 getPartitionOffset(U16 partitionIdx){
314 - assert(partitionIdx < _partitions.size());
316 + DIVIDE_ASSERT(partitionIdx < _partitions.size(), "VertexBuffer error: Invalid partition offset!");
315 317 return _partitions[partitionIdx].first;
316 318 }
317 319