From 1e08646c43e6a02f6dfb69de395f5394097a7fb8 Mon Sep 17 00:00:00 2001 From: "kbr@google.com" Date: Fri, 23 Apr 2010 22:01:10 +0000 Subject: Fixed problem in o3dConverter where it was not outputting all of the vertex data in JSON format. Fixed problems in effect.js where GLSL code path needed to name the texture coordinate attributes with the semantic names and not the names like "diffuseUV" because otherwise the backend did not know how to hook them up. Fixed problem with cube map faces being flipped and bug in binding cube map textures. At this point o3d-webgl can load the converted cube and teapot, though the teapot is currently missing the bump map. Tested O3D plugin with this sample to ensure no regression. BUG=none TEST=none Review URL: http://codereview.chromium.org/1729012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45495 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/serializer/cross/serializer.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'o3d/serializer') diff --git a/o3d/serializer/cross/serializer.cc b/o3d/serializer/cross/serializer.cc index 0aff9de..ccdc7ef 100644 --- a/o3d/serializer/cross/serializer.cc +++ b/o3d/serializer/cross/serializer.cc @@ -458,11 +458,12 @@ class CustomVisitor : public VisitorBase { Buffer* buffer = field->buffer(); if (buffer) { unsigned num_elements = buffer->num_elements(); + unsigned num_floats = num_elements * field->num_components(); scoped_array data( - new float[num_elements * field->num_components()]); + new float[num_floats]); field->GetAsFloats( 0, data.get(), field->num_components(), num_elements); - for (size_t jj = 0; jj < num_elements; ++jj) { + for (size_t jj = 0; jj < num_floats; ++jj) { Serialize(writer_, data[jj]); } } @@ -840,7 +841,7 @@ Serializer::Serializer(ServiceLocator* service_locator, new PropertiesVisitor(writer_, binary); sections_[CUSTOM_SECTION].name_ = "custom"; sections_[CUSTOM_SECTION].visitor_ = new CustomVisitor( - writer_, binary ? &binary_archive_manager_ : false); + writer_, binary ? &binary_archive_manager_ : NULL); param_visitor_ = new ParamVisitor(writer_); binary_visitor_ = binary ? new BinaryVisitor(&binary_archive_manager_) : NULL; } -- cgit v1.1