Permalink
Browse files

Fixes single node loading from a Bundle (now loads animations).

Updates Node::findNode to search any child mesh skin hierarchies.
Updated the GPB format (adds parent ID for nodes to support proper root node detection for mesh skins).
Updated all GPB files in the samples.
  • Loading branch information...
1 parent bee1a68 commit 81c202da9bfb364a266426224c6b4417b3e67314 @chrisculy chrisculy committed May 1, 2012
@@ -137,6 +137,7 @@ Reference
2->Node
type enum NodeType
transform float[16]
+ parent_id string
children Node[]
camera Camera
light Light
@@ -98,6 +98,7 @@
<ClInclude Include="src\VertexElement.h" />
</ItemGroup>
<ItemGroup>
+ <None Include="gameplay-bundle.txt" />
<None Include="src\Curve.inl" />
<None Include="src\Quaternion.inl" />
<None Include="src\Vector2.inl" />
@@ -269,6 +269,7 @@
<None Include="src\Curve.inl">
<Filter>src</Filter>
</None>
+ <None Include="gameplay-bundle.txt" />
</ItemGroup>
<ItemGroup>
<Filter Include="src">
@@ -64,8 +64,12 @@ void write(const std::string& str, FILE* file)
{
// Write the length of the string
write(str.size(), file);
- // Write the array of characters of the string
- write(str.c_str(), file);
+
+ if (str.size() > 0)
+ {
+ // Write the array of characters of the string
+ write(str.c_str(), file);
+ }
}
void writeZero(FILE* file)
@@ -21,7 +21,7 @@ namespace gameplay
* Increment the version number when making a change that break binary compatibility.
* [0] is major, [1] is minor.
*/
-const unsigned char GPB_VERSION[2] = {1, 1};
+const unsigned char GPB_VERSION[2] = {1, 2};
/**
* The GamePlay Binary file class handles writing the GamePlay Binary file.
@@ -40,6 +40,10 @@ void Node::writeBinary(FILE* file)
write(type, file);
write(_transform.m, 16, file);
+
+ // write parent's id
+ write((_parent) ? _parent->getId() : std::string(), file);
+
// children
write(getChildCount(), file); // write number of children
for (Node* node = getFirstChild(); node != NULL; node = node->getNextSibling())
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -101,6 +101,7 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../..//external-deps/bullet/include;../..//gameplay/src;../..//external-deps/openal/include/AL;../..//external-deps/oggvorbis/include;../..//external-deps/libpng/include;../..//external-deps/zlib/include;../..//external-deps/glew/include</AdditionalIncludeDirectories>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -132,6 +133,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ShowIncludes>false</ShowIncludes>
<PreprocessToFile>false</PreprocessToFile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Oops, something went wrong.

0 comments on commit 81c202d

Please sign in to comment.