diff options
| author | Alex Sakhartchouk <alexst@google.com> | 2010-05-21 12:53:13 -0700 |
|---|---|---|
| committer | Alex Sakhartchouk <alexst@google.com> | 2010-05-21 14:00:10 -0700 |
| commit | fb6b614bcea88a587a7ea4530be45ff0ffa0210e (patch) | |
| tree | a2a4b9bd296205421c718f1581e9b5824c7305ee /rsComponent.cpp | |
| parent | 66070bf7aae61cedde97cfdeb6a64f435abe8cde (diff) | |
Removed unnecessary change based on comments.
Now using android utils lib.
collada_to_a3d seems to work with android util libs.
Integrating old changelist
Changing assert to rsAssrt in VertexArray
making context compile.
Change-Id: I33890defa777f09253bfab630d97782359ec49d7
Added serialization code to rsLib
Integrated old changelist
Change-Id: Ie4746113f6d1817fbb3264f97fdddde25b779311
Added serialization code to rsLib
Change-Id: Ie4746113f6d1817fbb3264f97fdddde25b779311
Diffstat (limited to 'rsComponent.cpp')
| -rw-r--r-- | rsComponent.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rsComponent.cpp b/rsComponent.cpp index 15a56f7f..b120c21a 100644 --- a/rsComponent.cpp +++ b/rsComponent.cpp @@ -16,7 +16,11 @@ #include "rsComponent.h" +#ifndef ANDROID_RS_BUILD_FOR_HOST #include <GLES/gl.h> +#else +#include <OpenGL/gl.h> +#endif using namespace android; using namespace android::renderscript; @@ -334,4 +338,25 @@ void Component::dumpLOGV(const char *prefix) const prefix, gTypeStrings[mType], gKindStrings[mKind], mVectorSize, mBits); } +void Component::serialize(OStream *stream) const +{ + stream->addU8((uint8_t)mType); + stream->addU8((uint8_t)mKind); + stream->addU8((uint8_t)(mNormalized ? 1 : 0)); + stream->addU32(mVectorSize); +} + +void Component::loadFromStream(IStream *stream) +{ + mType = (RsDataType)stream->loadU8(); + mKind = (RsDataKind)stream->loadU8(); + uint8_t temp = stream->loadU8(); + mNormalized = temp != 0; + mVectorSize = stream->loadU32(); + + set(mType, mKind, mNormalized, mVectorSize); +} + + + |
