summaryrefslogtreecommitdiffstats
path: root/o3d/serializer
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 22:01:10 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 22:01:10 +0000
commit1e08646c43e6a02f6dfb69de395f5394097a7fb8 (patch)
tree06773af312b136c7f32973e4aae024f1cf44aeae /o3d/serializer
parent182434efa19ed7aaf0d7ce0b3164003174553cb7 (diff)
downloadchromium_src-1e08646c43e6a02f6dfb69de395f5394097a7fb8.zip
chromium_src-1e08646c43e6a02f6dfb69de395f5394097a7fb8.tar.gz
chromium_src-1e08646c43e6a02f6dfb69de395f5394097a7fb8.tar.bz2
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
Diffstat (limited to 'o3d/serializer')
-rw-r--r--o3d/serializer/cross/serializer.cc7
1 files changed, 4 insertions, 3 deletions
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<CustomVisitor> {
Buffer* buffer = field->buffer();
if (buffer) {
unsigned num_elements = buffer->num_elements();
+ unsigned num_floats = num_elements * field->num_components();
scoped_array<float> 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;
}