X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fvertexarray.cpp;h=30bc9bcc6588ae9233fe7491cc30f49dcf403124;hb=829d3bd891414405a4d388d22476ba1a98b654c3;hp=2bb6a6677b9ef5e2099a1a5922b1d2990910708c;hpb=d40673bd28c4b4524d3642b949d9d109dc6f9f24;p=libs%2Fgl.git diff --git a/source/core/vertexarray.cpp b/source/core/vertexarray.cpp index 2bb6a667..30bc9bcc 100644 --- a/source/core/vertexarray.cpp +++ b/source/core/vertexarray.cpp @@ -1,9 +1,4 @@ -#include -#include -#include "buffer.h" #include "error.h" -#include "gl.h" -#include "mesh.h" #include "vertexarray.h" using namespace std; @@ -40,7 +35,7 @@ void VertexArray::reserve(unsigned n) data.reserve(n*stride); } -float *VertexArray::append() +char *VertexArray::append() { if(format.empty()) throw invalid_operation("VertexArray::append"); @@ -50,7 +45,7 @@ float *VertexArray::append() return &*(data.end()-stride); } -float *VertexArray::modify(unsigned i) +char *VertexArray::modify(unsigned i) { if(format.empty()) throw invalid_operation("VertexArray::modify"); @@ -60,7 +55,7 @@ float *VertexArray::modify(unsigned i) unsigned VertexArray::get_data_size() const { - return data.size()*sizeof(float); + return data.size(); } @@ -71,6 +66,7 @@ VertexArray::Loader::Loader(VertexArray &a): add("vertex", static_cast(&Loader::vertex)); add("vertex", static_cast(&Loader::vertex)); add("normal", static_cast(&Loader::normal)); + add("tangent", static_cast(&Loader::tangent)); add("texcoord", static_cast(&Loader::texcoord)); add("texcoord", static_cast(&Loader::texcoord)); add("texcoord", static_cast(&Loader::texcoord)); @@ -93,33 +89,6 @@ VertexArray::Loader::Loader(VertexArray &a): add("weight", static_cast(&Loader::weight)); add("weight", static_cast(&Loader::weight)); add("weight", static_cast(&Loader::weight)); - - // Deprecated - add("vertex2", static_cast(&Loader::vertex)); - add("vertex3", static_cast(&Loader::vertex)); - add("vertex4", static_cast(&Loader::vertex)); - add("normal3", static_cast(&Loader::normal)); - add("texcoord1", static_cast(&Loader::texcoord)); - add("texcoord2", static_cast(&Loader::texcoord)); - add("texcoord3", static_cast(&Loader::texcoord)); - add("texcoord4", static_cast(&Loader::texcoord)); - add("multitexcoord1", static_cast(&Loader::multitexcoord)); - add("multitexcoord2", static_cast(&Loader::multitexcoord)); - add("multitexcoord3", static_cast(&Loader::multitexcoord)); - add("multitexcoord4", static_cast(&Loader::multitexcoord)); - add("color3", static_cast(&Loader::color)); - add("color4", static_cast(&Loader::color)); - add("generic1", static_cast(&Loader::generic)); - add("generic2", static_cast(&Loader::generic)); - add("generic3", static_cast(&Loader::generic)); - add("generic4", static_cast(&Loader::generic)); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - add("tangent3", static_cast(&Loader::tangent)); - add("binormal3", static_cast(&Loader::binormal)); - add("tangent", static_cast(&Loader::tangent)); - add("binormal", static_cast(&Loader::binormal)); -#pragma GCC diagnostic pop } } // namespace GL