Permalink
Browse files

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

Conflicts:
	bin/windows/gameplay-encoder.exe
  • Loading branch information...
2 parents c03bf9a + 4a0524e commit 23f33e75a59a2c6ddd56e4c29aef1ed30b63e968 @sgrenier sgrenier committed Oct 22, 2012
Showing with 786 additions and 178 deletions.
  1. +11 −11 CHANGES.md
  2. +9 −2 CMakeLists.txt
  3. +1 −1 README.md
  4. BIN bin/linux/gameplay-encoder
  5. BIN bin/macosx/gameplay-encoder
  6. 0 external-deps/bullet/lib/linux/{ → x64}/libBulletCollision.a
  7. 0 external-deps/bullet/lib/linux/{ → x64}/libBulletDynamics.a
  8. 0 external-deps/bullet/lib/linux/{ → x64}/libLinearMath.a
  9. BIN external-deps/bullet/lib/linux/x86/libBulletCollision.a
  10. BIN external-deps/bullet/lib/linux/x86/libBulletDynamics.a
  11. BIN external-deps/bullet/lib/linux/x86/libLinearMath.a
  12. 0 external-deps/collada-dom/lib/linux/{ → x64}/libcollada14dom.a
  13. BIN external-deps/collada-dom/lib/linux/x86/libcollada14dom.a
  14. 0 external-deps/freetype2/lib/linux/{ → x64}/libfreetype.a
  15. BIN external-deps/freetype2/lib/linux/x86/libfreetype.a
  16. 0 external-deps/glew/lib/linux/{ → x64}/libGLEW.a
  17. BIN external-deps/glew/lib/linux/x86/libGLEW.a
  18. 0 external-deps/libpng/lib/linux/{ → x64}/libpng.a
  19. BIN external-deps/libpng/lib/linux/x86/libpng.a
  20. 0 external-deps/lua/lib/linux/{ → x64}/liblua.a
  21. BIN external-deps/lua/lib/linux/x86/liblua.a
  22. 0 external-deps/oggvorbis/lib/linux/{ → x64}/libogg.a
  23. 0 external-deps/oggvorbis/lib/linux/{ → x64}/libvorbis.a
  24. BIN external-deps/oggvorbis/lib/linux/x86/libogg.a
  25. BIN external-deps/oggvorbis/lib/linux/x86/libvorbis.a
  26. 0 external-deps/openal/lib/linux/{ → x64}/libopenal.a
  27. BIN external-deps/openal/lib/linux/x86/libopenal.a
  28. 0 external-deps/zlib/lib/linux/{ → x64}/libz.a
  29. BIN external-deps/zlib/lib/linux/x86/libz.a
  30. +5 −4 gameplay-encoder/CMakeLists.txt
  31. +1 −1 gameplay-encoder/README.md
  32. +3 −3 gameplay-encoder/gameplay-bundle.txt
  33. +1 −1 gameplay-encoder/src/Animation.cpp
  34. +2 −2 gameplay-encoder/src/AnimationChannel.cpp
  35. +1 −1 gameplay-encoder/src/Animations.cpp
  36. +1 −7 gameplay-encoder/src/FileIO.cpp
  37. +2 −3 gameplay-encoder/src/FileIO.h
  38. +3 −3 gameplay-encoder/src/GPBFile.cpp
  39. +2 −2 gameplay-encoder/src/Mesh.cpp
  40. +2 −2 gameplay-encoder/src/MeshSkin.cpp
  41. +2 −2 gameplay-encoder/src/Object.h
  42. +1 −1 gameplay-encoder/src/ReferenceTable.cpp
  43. +6 −6 gameplay-samples/CMakeLists.txt
  44. +2 −2 gameplay-samples/sample01-longboard/android/jni/Android.mk
  45. +2 −2 gameplay-samples/sample02-spaceship/android/jni/Android.mk
  46. +2 −2 gameplay-samples/sample03-character/android/jni/Android.mk
  47. +2 −2 gameplay-samples/sample04-particles/android/jni/Android.mk
  48. +1 −1 gameplay-samples/sample05-lua/android/jni/Android.mk
  49. +1 −1 gameplay-samples/sample05-lua/src/LuaGame.h
  50. +6 −6 gameplay-samples/sample06-racer/android/jni/Android.mk
  51. +1 −1 gameplay-samples/sample06-racer/src/RacerGame.h
  52. +8 −2 gameplay-template/gameplay-template-CMakeLists.txt
  53. +30 −30 gameplay-tests/CMakeLists.txt
  54. +1 −1 gameplay-tests/src/Audio3DTest.cpp
  55. +1 −1 gameplay-tests/src/TestsGame.cpp
  56. +13 −13 gameplay/CMakeLists.txt
  57. +1 −1 gameplay/src/AnimationClip.cpp
  58. +1 −1 gameplay/src/AnimationTarget.h
  59. +1 −1 gameplay/src/Bundle.h
  60. +1 −1 gameplay/src/Button.h
  61. +1 −1 gameplay/src/CheckBox.h
  62. +16 −14 gameplay/src/Container.cpp
  63. +11 −3 gameplay/src/Container.h
  64. +2 −2 gameplay/src/Effect.cpp
  65. +1 −4 gameplay/src/FileSystem.cpp
  66. +8 −1 gameplay/src/FileSystem.h
  67. +1 −1 gameplay/src/Form.cpp
  68. +1 −1 gameplay/src/Form.h
  69. +1 −1 gameplay/src/Gamepad.h
  70. +1 −1 gameplay/src/Joystick.h
  71. +1 −1 gameplay/src/Label.h
  72. +1 −1 gameplay/src/Logger.cpp
  73. +1 −1 gameplay/src/Matrix.h
  74. +1 −1 gameplay/src/Node.cpp
  75. +1 −1 gameplay/src/Node.h
  76. +3 −3 gameplay/src/PhysicsCharacter.cpp
  77. +1 −1 gameplay/src/PhysicsCollisionObject.h
  78. +1 −1 gameplay/src/PhysicsController.cpp
  79. +10 −0 gameplay/src/PhysicsRigidBody.cpp
  80. +72 −3 gameplay/src/PhysicsRigidBody.h
  81. +38 −0 gameplay/src/PhysicsRigidBody.inl
  82. +1 −1 gameplay/src/PhysicsVehicleWheel.h
  83. +6 −9 gameplay/src/PlatformBlackBerry.cpp
  84. +1 −1 gameplay/src/Quaternion.cpp
  85. +1 −1 gameplay/src/RadioButton.h
  86. +1 −1 gameplay/src/RenderState.cpp
  87. +2 −0 gameplay/src/ScriptController.cpp
  88. +1 −1 gameplay/src/ScriptController.h
  89. +1 −1 gameplay/src/Slider.h
  90. +37 −0 gameplay/src/lua/lua_FileSystem.cpp
  91. +1 −0 gameplay/src/lua/lua_FileSystem.h
  92. +229 −0 gameplay/src/lua/lua_PhysicsRigidBody.cpp
  93. +4 −0 gameplay/src/lua/lua_PhysicsRigidBody.h
  94. +199 −1 gameplay/src/lua/lua_PhysicsRigidBodyParameters.cpp
  95. +2 −0 gameplay/src/lua/lua_PhysicsRigidBodyParameters.h
View
22 CHANGES.md
@@ -5,22 +5,22 @@
- CodeBlocks 10 IDE support for Linux.
- Gamepad controllers support for desktops.
- Touch gesture support for tap, swipe and pinch.
-- Vehicle phyics support via new PhysicsVehicle and PhysicsVehicleWheel classes.
+- Vehicle physics support via new PhysicsVehicle and PhysicsVehicleWheel classes.
- Adds new racer sample (sample06-racer).
- Adds gameplay-tests project as a test app for various basic engine features with some initial tests.
- Adds support for Scene files for wildcard identifiers.
- Adds Visual Studio Plug-in support for BlackBerry PlayBook and BlackBerry 10.
- Adds configurable multi-sampling anti-aliasing support.
- Adds updates to latest FBX SDK 2013.3.
-- Adds file formats documenation for game.config .scene, .material, .animation, .physics, .particle
+- Adds file formats documentation for game.config .scene, .material, .animation, .physics, .particle
- Adds Game/Platform::canExit for testing device capabilities to quit. (only ios)
- Web community forums at http://www.gameplay3d.org/forums.
- Changed keyTimes from unsigned long[] to unsigned int[]. (breaks compat. in AnimationTarget and Animation::Channel)
- Fixed inconsistencies from Bundle::getObjectID() to Bundle::getObjectId() (breaks compat. in Bundle)
- Fixes the texture coordinates of Mesh::createQuad(float x, float y, float width, float height).
-- Fixes line-wise distortion when loading RGB png's into texture that are non-power of two.
-- Fixes inconsitencies in createXXXX methods. (breaks compat. in Scene)
-- Fixes Rectanngle::contains.
+- Fixes line-wise distortion when loading RGB png's into textures that are non-power of two.
+- Fixes inconsistencies in createXXXX methods. (breaks compat. in Scene)
+- Fixes Rectangle::contains.
- Fixes Lua print logging.
- Fixes Lua errors to be treated as runtime warnings.
- Fixes setVertexData to pointers instead of constant data.
@@ -31,7 +31,7 @@
- Lua script bindings for all gameplay interfaces.
- Lua script binding generator tool (gameplay-luagen) for generating gameplay Lua bindings from doxygen xml output.
-- AIController, AIAgent, AIStateMachine, AIState and AIMessage clases for scripted AI support.
+- AIController, AIAgent, AIStateMachine, AIState and AIMessage classes for scripted AI support.
- Sample for sample05-lua to demonstrate basic Lua with AI scripting.
- Gamepad class with virtual gamepad support.
- Pre-built versions gameplay-encoder added to bin folder with TTF, DAE and FBX support built-in.
@@ -76,10 +76,10 @@
- BlackBerry 10 support.
- iOS 5.1 support.
- Android 2.3+ support.
-- User interface system with declaritive forms and themes.
+- User interface system with declarative forms and themes.
- Bluetooth keyboard/mouse support on BlackBerry platform.
- Developer guide.
-- Sample/turorial for sample03-character.
+- Sample/tutorial for sample03-character.
- Sample for sample04-particles to demonstrate particle emitters.
- Fixes for loading properties from URL.
- Fixes on Win32/MacOSX for when mouse pointer leaves the window and returns.
@@ -91,8 +91,8 @@
- FBX support in gameplay-encoder.
- MacOSX platform support using XCode.
-- Offscreen rendering functionality using FrameBuffer.
-- Loading 3D scences using declaritive .scene files.
+- Off-screen rendering functionality using FrameBuffer.
+- Loading 3D scenes using declarative .scene files.
- Loading audio from .ogg files using vorbis.
- Loading AudioSources from .audio files.
- Loading Animations from .animation files.
@@ -103,7 +103,7 @@
- Font improvements for justify, clip, wrap and scaling.
- Fixes for Font::drawText to use point size and not float scalar.
- Fixes for memory leaks in and fixes to AnimationTarget.
-- Fixes for bumped and paralax shaders.
+- Fixes for bumped and parallax shaders.
- Fixes to simplify folders for resources in samples.
- Fixes to the material/shader system.
- Fixes to the ParticleEmitter.
View
11 CMakeLists.txt
@@ -2,15 +2,22 @@ cmake_minimum_required(VERSION 2.6)
project(GamePlay)
-set(GAMEPLAY_VERSION 1.5.0)
+set(GAMEPLAY_VERSION 1.6.0)
set(CMAKE_C_COMPILER_INIT g++)
# debug
message( "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" )
-if( "${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" )
+if ( "${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" )
add_definitions(-D_DEBUG)
endif()
+# architecture
+if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+set(ARCH_DIR "x64")
+else()
+set(ARCH_DIR "x86")
+endif()
+
# gameplay library
add_subdirectory(gameplay)
View
2 README.md
@@ -16,7 +16,7 @@ An open-source, cross-platform 3D native C++ game framework making it easy to le
- Terrain and Water
- Asset Pipeline improvements
-## Licence
+## License
The project is open sourced under the Apache 2.0 license.
## Bug Reporting and Feature Requests
View
BIN bin/linux/gameplay-encoder
Binary file not shown.
View
BIN bin/macosx/gameplay-encoder
Binary file not shown.
View
0 ...eps/bullet/lib/linux/libBulletCollision.a → ...bullet/lib/linux/x64/libBulletCollision.a
File renamed without changes.
View
0 ...deps/bullet/lib/linux/libBulletDynamics.a → .../bullet/lib/linux/x64/libBulletDynamics.a
File renamed without changes.
View
0 ...nal-deps/bullet/lib/linux/libLinearMath.a → ...deps/bullet/lib/linux/x64/libLinearMath.a
File renamed without changes.
View
BIN external-deps/bullet/lib/linux/x86/libBulletCollision.a
Binary file not shown.
View
BIN external-deps/bullet/lib/linux/x86/libBulletDynamics.a
Binary file not shown.
View
BIN external-deps/bullet/lib/linux/x86/libLinearMath.a
Binary file not shown.
View
0 ...s/collada-dom/lib/linux/libcollada14dom.a → ...llada-dom/lib/linux/x64/libcollada14dom.a
File renamed without changes.
View
BIN external-deps/collada-dom/lib/linux/x86/libcollada14dom.a
Binary file not shown.
View
0 ...al-deps/freetype2/lib/linux/libfreetype.a → ...eps/freetype2/lib/linux/x64/libfreetype.a
File renamed without changes.
View
BIN external-deps/freetype2/lib/linux/x86/libfreetype.a
Binary file not shown.
View
0 external-deps/glew/lib/linux/libGLEW.a → external-deps/glew/lib/linux/x64/libGLEW.a
File renamed without changes.
View
BIN external-deps/glew/lib/linux/x86/libGLEW.a
Binary file not shown.
View
0 external-deps/libpng/lib/linux/libpng.a → external-deps/libpng/lib/linux/x64/libpng.a
File renamed without changes.
View
BIN external-deps/libpng/lib/linux/x86/libpng.a
Binary file not shown.
View
0 external-deps/lua/lib/linux/liblua.a → external-deps/lua/lib/linux/x64/liblua.a
File renamed without changes.
View
BIN external-deps/lua/lib/linux/x86/liblua.a
Binary file not shown.
View
0 external-deps/oggvorbis/lib/linux/libogg.a → ...nal-deps/oggvorbis/lib/linux/x64/libogg.a
File renamed without changes.
View
0 ...rnal-deps/oggvorbis/lib/linux/libvorbis.a → ...-deps/oggvorbis/lib/linux/x64/libvorbis.a
File renamed without changes.
View
BIN external-deps/oggvorbis/lib/linux/x86/libogg.a
Binary file not shown.
View
BIN external-deps/oggvorbis/lib/linux/x86/libvorbis.a
Binary file not shown.
View
0 external-deps/openal/lib/linux/libopenal.a → ...nal-deps/openal/lib/linux/x64/libopenal.a
File renamed without changes.
View
BIN external-deps/openal/lib/linux/x86/libopenal.a
Binary file not shown.
View
0 external-deps/zlib/lib/linux/libz.a → external-deps/zlib/lib/linux/x64/libz.a
File renamed without changes.
View
BIN external-deps/zlib/lib/linux/x86/libz.a
Binary file not shown.
View
9 gameplay-encoder/CMakeLists.txt
@@ -9,13 +9,14 @@ include_directories(
/usr/include
)
+add_definitions(-D_DEBUG)
add_definitions(-D__linux__ -DNO_BOOST -DNO_ZAE)
link_directories(
- ${CMAKE_SOURCE_DIR}/external-deps/zlib/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/libpng/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/freetype2/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/collada-dom/lib/linux
+ ${CMAKE_SOURCE_DIR}/external-deps/zlib/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/libpng/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/freetype2/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/collada-dom/lib/linux/${ARCH_DIR}
/usr/lib
)
View
2 gameplay-encoder/README.md
@@ -22,7 +22,7 @@ For more information goto "http://www.autodesk.com/fbx".
## Building gameplay-encoder
The gameplay-encoder comes pre-built for Windows 7, MacOS X and Linux x64 in the 'bin' folder.
-However, to build the gameplay-ecoder yourself just open either the
+However, to build the gameplay-encoder yourself just open either the
Visual Studio 2010 project "gameplay-encoder.vccproj" on Windows 7 or
XCode project "gameplay-encoder.xcodeproj" on MacOSX.
Uncomment the root CMakeList.txt for the gameplay-encoder and run standard cmake .. from build then make.
View
6 gameplay-encoder/gameplay-bundle.txt
@@ -3,7 +3,7 @@ gameplay Bundle File Format (.gpb)
File Description
================
-A simple binary bundle file format supporting definition of primitve and builtin objects.
+A simple binary bundle file format supporting definition of primitive and built-in objects.
File Extension and Mime Type
============================
@@ -15,7 +15,7 @@ File Structure
Section Name Type
------------------------------------------------------------------------------------------------------
Header
- Identifier byte[9] = { '', 'G', 'P', 'B', '', '\r', '\n', '\x1A', '\n' }
+ Identifier byte[9] = { '\xAB', 'G', 'P', 'B', '\xBB', '\r', '\n', '\x1A', '\n' }
Version byte[2] = { 1, 1 }
References Reference[]
Data
@@ -42,7 +42,7 @@ Xrefs
Xrefs are string with a specific format used for referencing objects internal and external to
a package. An xref with the format "#id" references an object within the current package with
the given ID. Xrefs can also have the format "file#id", where "file" is the name of package file
-(relative to the locaiton of the current package) and "id" is the unique identifier of an object
+(relative to the location of the current package) and "id" is the unique identifier of an object
in that bundle.
Primitives
View
2 gameplay-encoder/src/Animation.cpp
@@ -26,7 +26,7 @@ void Animation::writeBinary(FILE* file)
Object::writeBinary(file);
// Animation writes its ID because it is not listed in the ref table.
write(getId(), file);
- write(_channels.size(), file);
+ write((unsigned int)_channels.size(), file);
for (std::vector<AnimationChannel*>::iterator i = _channels.begin(); i != _channels.end(); ++i)
{
(*i)->writeBinary(file);
View
4 gameplay-encoder/src/AnimationChannel.cpp
@@ -28,10 +28,10 @@ void AnimationChannel::writeBinary(FILE* file)
Object::writeBinary(file);
write(_targetId, file);
write(_targetAttrib, file);
- write(_keytimes.size(), file);
+ write((unsigned int)_keytimes.size(), file);
for (std::vector<float>::const_iterator i = _keytimes.begin(); i != _keytimes.end(); ++i)
{
- write((unsigned long)*i, file);
+ write((unsigned int)*i, file);
}
write(_keyValues, file);
write(_tangentsIn, file);
View
2 gameplay-encoder/src/Animations.cpp
@@ -27,7 +27,7 @@ const char* Animations::getElementName(void) const
void Animations::writeBinary(FILE* file)
{
Object::writeBinary(file);
- write(_animations.size(), file);
+ write((unsigned int)_animations.size(), file);
for (std::vector<Animation*>::iterator i = _animations.begin(); i != _animations.end(); ++i)
{
(*i)->writeBinary(file);
View
8 gameplay-encoder/src/FileIO.cpp
@@ -31,12 +31,6 @@ void write(unsigned int value, FILE* file)
assert(r == 1);
}
-void write(unsigned long value, FILE* file)
-{
- size_t r = fwrite(&value, sizeof(unsigned long), 1, file);
- assert(r == 1);
-}
-
void write(unsigned short value, FILE* file)
{
size_t r = fwrite(&value, sizeof(unsigned short), 1, file);
@@ -63,7 +57,7 @@ void write(const float* values, int length, FILE* file)
void write(const std::string& str, FILE* file)
{
// Write the length of the string
- write(str.size(), file);
+ write((unsigned int)str.size(), file);
if (str.size() > 0)
{
View
5 gameplay-encoder/src/FileIO.h
@@ -64,7 +64,6 @@ void write(unsigned char value, FILE* file);
void write(char value, FILE* file);
void write(const char* str, FILE* file);
void write(unsigned int value, FILE* file);
-void write(unsigned long value, FILE* file);
void write(unsigned short value, FILE* file);
void write(bool value, FILE* file);
void write(float value, FILE* file);
@@ -87,7 +86,7 @@ template <class T>
void write(std::list<T> list, FILE* file)
{
// First write the size of the list
- write(list.size(), file);
+ write((unsigned int)list.size(), file);
// Then write each element
typename std::list<T>::const_iterator i;
for (i = list.begin(); i != list.end(); ++i)
@@ -106,7 +105,7 @@ template <class T>
void write(std::vector<T> vector, FILE* file)
{
// First write the size of the vector
- write(vector.size(), file);
+ write((unsigned int)vector.size(), file);
// Then write each element
typename std::vector<T>::const_iterator i;
for (i = vector.begin(); i != vector.end(); ++i)
View
6 gameplay-encoder/src/GPBFile.cpp
@@ -67,7 +67,7 @@ bool GPBFile::saveBinary(const std::string& filepath)
size_t n = 0;
// identifier
- char identifier[] = { '', 'G', 'P', 'B', '', '\r', '\n', '\x1A', '\n' };
+ char identifier[] = { '\xAB', 'G', 'P', 'B', '\xBB', '\r', '\n', '\x1A', '\n' };
n = fwrite(identifier, 1, sizeof(identifier), _file);
if (n != sizeof(identifier))
{
@@ -89,14 +89,14 @@ bool GPBFile::saveBinary(const std::string& filepath)
_refTable.writeBinary(_file);
// meshes
- write(_geometry.size(), _file);
+ write((unsigned int)_geometry.size(), _file);
for (std::list<Mesh*>::const_iterator i = _geometry.begin(); i != _geometry.end(); ++i)
{
(*i)->writeBinary(_file);
}
// Objects
- write(_objects.size(), _file);
+ write((unsigned int)_objects.size(), _file);
for (std::list<Object*>::const_iterator i = _objects.begin(); i != _objects.end(); ++i)
{
(*i)->writeBinary(_file);
View
4 gameplay-encoder/src/Mesh.cpp
@@ -27,7 +27,7 @@ void Mesh::writeBinary(FILE* file)
{
Object::writeBinary(file);
// vertex formats
- write(_vertexFormat.size(), file);
+ write((unsigned int)_vertexFormat.size(), file);
for (std::vector<VertexElement>::iterator i = _vertexFormat.begin(); i != _vertexFormat.end(); ++i)
{
i->writeBinary(file);
@@ -45,7 +45,7 @@ void Mesh::writeBinaryVertices(FILE* file)
// Assumes that all vertices are the same size.
// Write the number of bytes for the vertex data
const Vertex& vertex = vertices.front();
- write(vertices.size() * vertex.byteSize(), file); // (vertex count) * (vertex size)
+ write((unsigned int)(vertices.size() * vertex.byteSize()), file); // (vertex count) * (vertex size)
// for each vertex
for (std::vector<Vertex>::const_iterator i = vertices.begin(); i != vertices.end(); ++i)
View
4 gameplay-encoder/src/MeshSkin.cpp
@@ -36,12 +36,12 @@ void MeshSkin::writeBinary(FILE* file)
{
Object::writeBinary(file);
write(_bindShape, 16, file);
- write(_joints.size(), file);
+ write((unsigned int)_joints.size(), file);
for (std::vector<Node*>::const_iterator i = _joints.begin(); i != _joints.end(); ++i)
{
(*i)->writeBinaryXref(file);
}
- write(_bindPoses.size() * 16, file);
+ write((unsigned int)_bindPoses.size() * 16, file);
for (std::vector<Matrix>::const_iterator i = _bindPoses.begin(); i != _bindPoses.end(); ++i)
{
write(i->m, 16, file);
View
4 gameplay-encoder/src/Object.h
@@ -109,7 +109,7 @@ class Object
static void writeBinaryObjects(std::list<T> list, FILE* file)
{
// First write the size of the list
- write(list.size(), file);
+ write((unsigned int)list.size(), file);
// Then write each element
typename std::list<T>::const_iterator i;
for (i = list.begin(); i != list.end(); ++i)
@@ -125,7 +125,7 @@ class Object
static void writeBinaryObjects(std::vector<T> vector, FILE* file)
{
// First write the size of the vector
- write(vector.size(), file);
+ write((unsigned int)vector.size(), file);
// Then write each element
typename std::vector<T>::const_iterator i;
for (i = vector.begin(); i != vector.end(); ++i)
View
2 gameplay-encoder/src/ReferenceTable.cpp
@@ -30,7 +30,7 @@ Object* ReferenceTable::get(const std::string& xref)
void ReferenceTable::writeBinary(FILE* file)
{
- write(_table.size(), file);
+ write((unsigned int)_table.size(), file);
for ( std::map<std::string, Reference>::iterator i=_table.begin() ; i != _table.end(); ++i)
{
i->second.writeBinary(file);
View
12 gameplay-samples/CMakeLists.txt
@@ -14,12 +14,12 @@ include_directories(
add_definitions(-D__linux__)
link_directories(
- ${CMAKE_SOURCE_DIR}/external-deps/lua/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/zlib/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/libpng/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/bullet/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/oggvorbis/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/glew/lib/linux
+ ${CMAKE_SOURCE_DIR}/external-deps/lua/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/zlib/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/libpng/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/bullet/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/oggvorbis/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/glew/lib/linux/${ARCH_DIR}
)
View
4 gameplay-samples/sample01-longboard/android/jni/Android.mk
@@ -16,7 +16,7 @@
SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
-LUA_PATH := ../../../../gameplay/external-deps/lua/lib/android/arm
+LUA_PATH := $(call my-dir)/../../../../external-deps/lua/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
@@ -78,7 +78,7 @@ LOCAL_MODULE := sample01-longboard
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp LongboardGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../../GamePlay/external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib liblua libbullet libvorbis libOpenAL
View
4 gameplay-samples/sample02-spaceship/android/jni/Android.mk
@@ -16,7 +16,7 @@
SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
-LUA_PATH := ../../../../gameplay/external-deps/lua/lib/android/arm
+LUA_PATH := $(call my-dir)/../../../../external-deps/lua/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
@@ -78,7 +78,7 @@ LOCAL_MODULE := sample02-spaceship
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp SpaceshipGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../../GamePlay/external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib liblua libbullet libvorbis libOpenAL
View
4 gameplay-samples/sample03-character/android/jni/Android.mk
@@ -16,7 +16,7 @@
SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
-LUA_PATH := ../../../../gameplay/external-deps/lua/lib/android/arm
+LUA_PATH := $(call my-dir)/../../../../external-deps/lua/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
@@ -78,7 +78,7 @@ LOCAL_MODULE := sample03-character
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp CharacterGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../../GamePlay/external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib liblua libbullet libvorbis libOpenAL
View
4 gameplay-samples/sample04-particles/android/jni/Android.mk
@@ -16,7 +16,7 @@
SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
-LUA_PATH := ../../../../gameplay/external-deps/lua/lib/android/arm
+LUA_PATH := $(call my-dir)/../../../../external-deps/lua/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
@@ -78,7 +78,7 @@ LOCAL_MODULE := sample04-particles
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp ParticlesGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../../GamePlay/external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -Wno-psabi -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib liblua libbullet libvorbis libOpenAL
View
2 gameplay-samples/sample05-lua/android/jni/Android.mk
@@ -16,7 +16,7 @@
SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
-LUA_PATH := ../../../../gameplay/external-deps/lua/lib/android/arm
+LUA_PATH := $(call my-dir)/../../../../external-deps/lua/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
View
2 gameplay-samples/sample05-lua/src/LuaGame.h
@@ -15,7 +15,7 @@ class LuaGame: public Game
public:
/**
- * Constructror.
+ * Constructor.
*/
LuaGame();
View
12 gameplay-samples/sample06-racer/android/jni/Android.mk
@@ -14,12 +14,12 @@
#
SAMPLE_PATH := $(call my-dir)/../../src
-LIBPNG_PATH := ../../../external-deps/libpng/lib/android/arm
-ZLIB_PATH := ../../../external-deps/zlib/lib/android/arm
-LUA_PATH := ../../../external-deps/lua/lib/android/arm
-BULLET_PATH := ../../../external-deps/bullet/lib/android/arm
-VORBIS_PATH := ../../../external-deps/oggvorbis/lib/android/arm
-OPENAL_PATH := ../../../external-deps/openal/lib/android/arm
+LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
+ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
+LUA_PATH := $(call my-dir)/../../../../external-deps/lua/lib/android/arm
+BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
+VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
+OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
# gameplay
LOCAL_PATH := ../../../gameplay/android/obj/local/armeabi
View
2 gameplay-samples/sample06-racer/src/RacerGame.h
@@ -13,7 +13,7 @@ class RacerGame: public Game, Control::Listener
public:
/**
- * Constructror.
+ * Constructor.
*/
RacerGame();
View
10 gameplay-template/gameplay-template-CMakeLists.txt
@@ -3,6 +3,12 @@ PROJECT(TEMPLATE_PROJECT)
set(GAME_NAME TEMPLATE_PROJECT)
+if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+ set(ARCH_DIR "x64" )
+else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+ set(ARCH_DIR "x86" )
+endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+
set(GAMEPLAY_SRC_PATH "GAMEPLAY_PATH")
set(GAMEPLAY_EXT_LIBS_PATH "${GAMEPLAY_SRC_PATH}/external-deps")
@@ -23,7 +29,7 @@ macro (append_gameplay_ext_lib listToAppend libName libDirName)
find_library(FOUND_LIB_${libName} ${libName})
ELSE("${libDirName}" STREQUAL "")
set(pathToSearch
- "${GAMEPLAY_EXT_LIBS_PATH}/${libDirName}/lib/${TARGET_OS_DIR}")
+ "${GAMEPLAY_EXT_LIBS_PATH}/${libDirName}/lib/${TARGET_OS_DIR}/${ARCH_DIR}")
find_library(FOUND_LIB_${libName} ${libName} HINTS ${pathToSearch})
ENDIF("${libDirName}" STREQUAL "")
@@ -32,7 +38,7 @@ macro (append_gameplay_ext_lib listToAppend libName libDirName)
endmacro (append_gameplay_ext_lib)
macro(copy_files TARGET_NAME GLOBPAT SOURCE DESTINATION)
- file(GLOB COPY_FILES
+ file(GLOB_RECURSE COPY_FILES
RELATIVE ${SOURCE}
"${SOURCE}/${GLOBPAT}")
add_custom_target(${TARGET_NAME} ALL
View
60 gameplay-tests/CMakeLists.txt
@@ -13,12 +13,12 @@ include_directories(
add_definitions(-D__linux__)
link_directories(
- ${CMAKE_SOURCE_DIR}/external-deps/lua/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/zlib/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/libpng/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/bullet/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/oggvorbis/lib/linux
- ${CMAKE_SOURCE_DIR}/external-deps/glew/lib/linux
+ ${CMAKE_SOURCE_DIR}/external-deps/lua/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/zlib/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/libpng/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/bullet/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/oggvorbis/lib/linux/${ARCH_DIR}
+ ${CMAKE_SOURCE_DIR}/external-deps/glew/lib/linux/${ARCH_DIR}
)
@@ -48,38 +48,38 @@ set( GAME_NAME gameplay-tests)
set(GAME_SRC
src/FirstPersonCamera.cpp
- src/FirstPersonCamera.h
+ src/FirstPersonCamera.h
src/Grid.cpp
- src/Grid.h
+ src/Grid.h
src/Test.cpp
- src/Test.h
+ src/Test.h
src/TestsGame.cpp
- src/TestsGame.h
+ src/TestsGame.h
src/Audio3DTest.cpp
- src/Audio3DTest.h
- src/CreateSceneTest.cpp
- src/CreateSceneTest.h
- src/CreateSceneTest.h
+ src/Audio3DTest.h
+ src/CreateSceneTest.cpp
+ src/CreateSceneTest.h
+ src/CreateSceneTest.h
src/GestureTest.cpp
src/GestureTest.h
src/InputTest.cpp
src/InputTest.h
- src/LoadSceneTest.cpp
- src/LoadSceneTest.h
- src/MeshBatchTest.cpp
- src/MeshBatchTest.h
- src/MeshPrimitiveTest.cpp
- src/MeshPrimitiveTest.h
- src/PhysicsSceneTest.cpp
- src/PhysicsSceneTest.h
- src/SpriteBatchTest.cpp
- src/SpriteBatchTest.h
- src/TextTest.cpp
- src/TextTest.h
- src/TextureTest.cpp
- src/TextureTest.h
- src/TriangleTest.cpp
- src/TriangleTest.h
+ src/LoadSceneTest.cpp
+ src/LoadSceneTest.h
+ src/MeshBatchTest.cpp
+ src/MeshBatchTest.h
+ src/MeshPrimitiveTest.cpp
+ src/MeshPrimitiveTest.h
+ src/PhysicsSceneTest.cpp
+ src/PhysicsSceneTest.h
+ src/SpriteBatchTest.cpp
+ src/SpriteBatchTest.h
+ src/TextTest.cpp
+ src/TextTest.h
+ src/TextureTest.cpp
+ src/TextureTest.h
+ src/TriangleTest.cpp
+ src/TriangleTest.h
)
add_executable(${GAME_NAME}
View
2 gameplay-tests/src/Audio3DTest.cpp
@@ -229,7 +229,7 @@ void Audio3DTest::keyEvent(Keyboard::KeyEvent evt, int key)
case Keyboard::KEY_ONE:
case Keyboard::KEY_SPACE:
- addSound("Footsteps.wav");
+ addSound("footsteps.wav");
break;
}
}
View
2 gameplay-tests/src/TestsGame.cpp
@@ -57,7 +57,7 @@ void TestsGame::initialize()
Button* testButton = Button::create(testRecord.title.c_str(), buttonStyle);
testButton->setText(testRecord.title.c_str());
testButton->setAutoWidth(true);
- testButton->setHeight(40); // Tall enough to touch easily on a BB10 device.
+ testButton->setHeight(60); // Tall enough to touch easily on a BB10 device.
testButton->setConsumeInputEvents(false); // This lets the user scroll the container if they swipe starting from a button.
testButton->addListener(this, Control::Listener::CLICK);
_testSelectForm->addControl(testButton);
View
26 gameplay/CMakeLists.txt
@@ -77,7 +77,7 @@ set(GAMEPLAY_SRC
src/gameplay-main-blackberry.cpp
src/gameplay-main-linux.cpp
src/gameplay-main-windows.cpp
- src/Gesture.h
+ src/Gesture.h
src/Image.cpp
src/Image.h
src/Image.inl
@@ -146,10 +146,10 @@ set(GAMEPLAY_SRC
src/PhysicsSocketConstraint.h
src/PhysicsSpringConstraint.cpp
src/PhysicsSpringConstraint.h
- src/PhysicsVehicle.cpp
- src/PhysicsVehicle.h
- src/PhysicsVehicleWheel.cpp
- src/PhysicsVehicle.h
+ src/PhysicsVehicle.cpp
+ src/PhysicsVehicle.h
+ src/PhysicsVehicleWheel.cpp
+ src/PhysicsVehicle.h
src/Plane.cpp
src/Plane.h
src/Plane.inl
@@ -333,10 +333,10 @@ set(GAMEPLAY_LUA
src/lua/lua_GamepadGamepadEvent.h
src/lua/lua_GameState.cpp
src/lua/lua_GameState.h
- src/lua/lua_Gesture.cpp
- src/lua/lua_Gesture.h
- src/lua/lua_GestureGestureEvent.cpp
- src/lua/lua_GestureGestureEvent.h
+ src/lua/lua_Gesture.cpp
+ src/lua/lua_Gesture.h
+ src/lua/lua_GestureGestureEvent.cpp
+ src/lua/lua_GestureGestureEvent.h
src/lua/lua_Global.cpp
src/lua/lua_Global.h
src/lua/lua_Image.cpp
@@ -451,10 +451,10 @@ set(GAMEPLAY_LUA
src/lua/lua_PhysicsSocketConstraint.h
src/lua/lua_PhysicsSpringConstraint.cpp
src/lua/lua_PhysicsSpringConstraint.h
- src/lua/lua_PhysicsVehicle.cpp
- src/lua/lua_PhysicsVehicle.h
- src/lua/lua_PhysicsVehicleWheel.cpp
- src/lua/lua_PhysicsVehicleWheel.h
+ src/lua/lua_PhysicsVehicle.cpp
+ src/lua/lua_PhysicsVehicle.h
+ src/lua/lua_PhysicsVehicleWheel.cpp
+ src/lua/lua_PhysicsVehicleWheel.h
src/lua/lua_Plane.cpp
src/lua/lua_Plane.h
src/lua/lua_Platform.cpp
View
2 gameplay/src/AnimationClip.cpp
@@ -248,7 +248,7 @@ void AnimationClip::crossFade(AnimationClip* clip, unsigned long duration)
_crossFadeToClip->setClipStateBit(CLIP_IS_FADING_IN_BIT);
_crossFadeToClip->_blendWeight = 0.0f;
- // Set and intiliaze this clip to fade out
+ // Set and initialize this clip to fade out
setClipStateBit(CLIP_IS_FADING_OUT_STARTED_BIT);
setClipStateBit(CLIP_IS_FADING_OUT_BIT);
_crossFadeOutElapsed = 0.0f;
View
2 gameplay/src/AnimationTarget.h
@@ -215,7 +215,7 @@ class AnimationTarget
*
* @param type The TargetType of the AnimationTarget.
* @param propertyIdStr The property ID string.
- * @return The property ID value for teh property ID string; -1 if the propertyIdStr does not exist
+ * @return The property ID value for the property ID string; -1 if the propertyIdStr does not exist
* for the TargetType.
*/
static int getPropertyId(TargetType type, const char* propertyIdStr);
View
2 gameplay/src/Bundle.h
@@ -285,7 +285,7 @@ class Bundle : public Ref
*
* @param length A pointer to where the length of the array will be copied to.
* @param values A pointer to the vector to copy the values to. The vector will be resized if it is smaller than length.
- * @param readSize The size that reads will be preformed at, size must be the same as or smaller then the sizeof(T)
+ * @param readSize The size that reads will be performed at, size must be the same as or smaller then the sizeof(T)
*
* @return True if successful, false if an error occurred.
*/
View
2 gameplay/src/Button.h
@@ -27,7 +27,7 @@ namespace gameplay
width = <width> // Can be used in place of 'size', e.g. with 'autoHeight = true'
height = <height> // Can be used in place of 'size', e.g. with 'autoWidth = true'
text = <string>
- consumeEvents = <bool> // Whether the button propogates input events to the Game's input event handler. Defualt is true.
+ consumeEvents = <bool> // Whether the button propagates input events to the Game's input event handler. Default is true.
}
@endverbatim
*/
View
2 gameplay/src/CheckBox.h
@@ -28,7 +28,7 @@ namespace gameplay
text = <string>
checked = <bool>
iconSize = <width, height> // The size to draw the checkbox icon, if different from its size in the texture.
- consumeEvents = <bool> // Whether the checkbox propogates input events to the Game's input event handler. Default is true.
+ consumeEvents = <bool> // Whether the checkbox propagates input events to the Game's input event handler. Default is true.
}
@endverbatim
*/
View
30 gameplay/src/Container.cpp
@@ -37,7 +37,7 @@ Container::Container()
_scrollBarLeftCap(NULL), _scrollBarHorizontal(NULL), _scrollBarRightCap(NULL),
_scroll(SCROLL_NONE), _scrollBarBounds(Rectangle::empty()), _scrollPosition(Vector2::zero()),
_scrollBarsAutoHide(false), _scrollBarOpacity(1.0f), _scrolling(false),
- _scrollingFirstX(0), _scrollingFirstY(0), _scrollingLastX(0), _scrollingLastY(0),
+ _scrollingVeryFirstX(0), _scrollingVeryFirstY(0), _scrollingFirstX(0), _scrollingFirstY(0), _scrollingLastX(0), _scrollingLastY(0),
_scrollingStartTimeX(0), _scrollingStartTimeY(0), _scrollingLastTime(0),
_scrollingVelocity(Vector2::zero()), _scrollingFriction(1.0f),
_scrollingRight(false), _scrollingDown(false),
@@ -369,8 +369,8 @@ bool Container::isScrolling() const
return true;
return (_scrolling &&
- (abs(_scrollingLastX - _scrollingFirstX) > SCROLL_THRESHOLD ||
- abs(_scrollingLastY - _scrollingFirstY) > SCROLL_THRESHOLD));
+ (abs(_scrollingLastX - _scrollingVeryFirstX) > SCROLL_THRESHOLD ||
+ abs(_scrollingLastY - _scrollingVeryFirstY) > SCROLL_THRESHOLD));
}
Animation* Container::getAnimation(const char* id) const
@@ -803,8 +803,8 @@ bool Container::touchEventScroll(Touch::TouchEvent evt, int x, int y, unsigned i
{
_contactIndex = (int) contactIndex;
_contactIndices++;
- _scrollingLastX = _scrollingFirstX = x;
- _scrollingLastY = _scrollingFirstY = y;
+ _scrollingLastX = _scrollingFirstX = _scrollingVeryFirstX = x;
+ _scrollingLastY = _scrollingFirstY = _scrollingVeryFirstY = y;
_scrollingVelocity.set(0, 0);
_scrolling = true;
_scrollingStartTimeX = _scrollingStartTimeY = 0;
@@ -956,7 +956,7 @@ bool Container::mouseEventScroll(Mouse::MouseEvent evt, int x, int y, int wheelD
if (x + _viewportBounds.x >= vBounds.x &&
x + _viewportBounds.x <= vBounds.x + vBounds.width)
{
- // Then we're within the horizontal bounds of the verticle scrollbar.
+ // Then we're within the horizontal bounds of the vertical scrollbar.
// We want to either jump up or down, or drag the scrollbar itself.
if (y < vBounds.y)
{
@@ -1107,13 +1107,11 @@ bool Container::pointerEvent(bool mouse, char evt, int x, int y, int data)
}
break;
case Touch::TOUCH_RELEASE:
- {
- if (eventConsumed)
- {
- if (_contactIndices > 0)
- _contactIndices--;
- }
- }
+ if (eventConsumed)
+ {
+ if (_contactIndices > 0)
+ _contactIndices--;
+ }
break;
}
@@ -1127,7 +1125,11 @@ bool Container::pointerEvent(bool mouse, char evt, int x, int y, int data)
}
release();
- return (_consumeInputEvents | eventConsumed);
+ if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
+ y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
+ return (_consumeInputEvents | eventConsumed);
+ else
+ return eventConsumed;
}
Container::Scroll Container::getScroll(const char* scroll)
View
14 gameplay/src/Container.h
@@ -27,7 +27,7 @@ namespace gameplay
height = <height> // Can be used in place of 'size', e.g. with 'autoWidth = true'
scroll = <Container::Scroll constant> // Whether scrolling is allowed and in which directions.
scrollBarsAutoHide = <bool> // Whether scrollbars fade out when not in use.
- consumeEvents = <bool> // Whether the container propogates input events to the Game's input event handler. Default is true.
+ consumeEvents = <bool> // Whether the container propagates input events to the Game's input event handler. Default is true.
// All the nested controls within this container.
container
@@ -444,11 +444,19 @@ class Container : public Control
*/
bool _scrolling;
/**
- * First scrolling touch x position
+ * First scrolling touch x position
+ */
+ int _scrollingVeryFirstX;
+ /**
+ * First scrolling touch y position
+ */
+ int _scrollingVeryFirstY;
+ /**
+ * First scrolling touch x position since last change in direction.
*/
int _scrollingFirstX;
/**
- * First scrolling touch y position
+ * First scrolling touch y position since last change in direction.
*/
int _scrollingFirstY;
/**
View
4 gameplay/src/Effect.cpp
@@ -220,7 +220,7 @@ Effect* Effect::createFromSource(const char* vshPath, const char* vshSource, con
GLint length;
GLint success;
- // Replace all comma seperated definitions with #define prefix and \n suffix
+ // Replace all comma separated definitions with #define prefix and \n suffix
std::string definesStr = "";
replaceDefines(defines, definesStr);
@@ -355,7 +355,7 @@ Effect* Effect::createFromSource(const char* vshPath, const char* vshSource, con
// preferred attribute locations, we're going to query the locations that were
// automatically bound by the GPU. While it can sometimes be convenient to use
// glBindAttribLocation, some vendors actually reserve certain attribute indices
- // and thereore using this function can create compatibility issues between
+ // and therefore using this function can create compatibility issues between
// different hardware vendors.
GLint activeAttributes;
GL_ASSERT( glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &activeAttributes) );
View
5 gameplay/src/FileSystem.cpp
@@ -25,9 +25,6 @@ extern AAssetManager* __assetManager;
namespace gameplay
{
-// Creates a file on the file system from the specified asset (Android-specific).
-static void createFileFromAsset(const char* path);
-
#ifdef __ANDROID__
#include <unistd.h>
@@ -334,7 +331,7 @@ bool FileSystem::isAbsolutePath(const char* filePath)
#endif
}
-void createFileFromAsset(const char* path)
+void FileSystem::createFileFromAsset(const char* path)
{
#ifdef __ANDROID__
static std::set<std::string> upToDateAssets;
View
9 gameplay/src/FileSystem.h
@@ -39,7 +39,7 @@ class FileSystem
* Loads a properties file containing a list of filesystem aliases.
*
* The specified aliases file is a valid properties file that contains one
- * or more namespaces with a list of fielsystem aliases that will be used
+ * or more namespaces with a list of filesystem aliases that will be used
* to establish soft links to files when reading files through this class.
*
* This can be helpful for managing loading of resources that may change
@@ -146,6 +146,13 @@ class FileSystem
*/
static bool isAbsolutePath(const char* filePath);
+ /**
+ * Creates a file on the file system from the specified asset (Android-specific).
+ *
+ * @param path The path to the file.
+ */
+ static void createFileFromAsset(const char* path);
+
private:
/**
View
2 gameplay/src/Form.cpp
@@ -538,7 +538,7 @@ void Form::draw()
// to texture a quad. The quad will be given the same dimensions as the form and
// must be transformed appropriately by the user, unless they call setQuad() themselves.
// On the other hand, if this form has not been set on a node, SpriteBatch will be used
- // to render the contents of the frambuffer directly to the display.
+ // to render the contents of the framebuffer directly to the display.
// Check whether this form has changed since the last call to draw() and if so, render into the framebuffer.
if (isDirty())
View
2 gameplay/src/Form.h
@@ -32,7 +32,7 @@ class Theme;
size = <width, height> // Size of the form, measured in pixels.
width = <width> // Can be used in place of 'size', e.g. with 'autoHeight = true'
height = <height> // Can be used in place of 'size', e.g. with 'autoWidth = true'
- consumeEvents = <bool> // Whether the form propogates input events to the Game's input event handler. Default is false
+ consumeEvents = <bool> // Whether the form propagates input events to the Game's input event handler. Default is false
// All the nested controls within this form.
container { }
View
2 gameplay/src/Gamepad.h
@@ -111,7 +111,7 @@ class Gamepad
*
* Note: What if the user decides to add gamepad controls (joysticks, buttons) to the gamepad form? How do we handle new/deleted controls?
*
- * @return the Form used to represent this gamepad. NULL if the gamepad is not reprented with a Form.
+ * @return the Form used to represent this gamepad. NULL if the gamepad is not represented with a Form.
*/
Form* getForm() const;
View
2 gameplay/src/Joystick.h
@@ -17,7 +17,7 @@ namespace gameplay
alignment = <Control::Alignment constant> // Note: 'position' will be ignored.
size = <width, height> // Size of the Control, measured in pixels.
radius = <float> // The value of the left- / bottom-most point on the slider.
- consumeEvents = <bool> // Whether the slider propogates input events to the Game's input event handler. Default is true.
+ consumeEvents = <bool> // Whether the slider propagates input events to the Game's input event handler. Default is true.
}
@endverbatim
View
2 gameplay/src/Label.h
@@ -24,7 +24,7 @@ namespace gameplay
width = <width> // Can be used in place of 'size', e.g. with 'autoHeight = true'
height = <height> // Can be used in place of 'size', e.g. with 'autoWidth = true'
text = <string>
- consumeEvents = <bool> // Whether the label propogates input events to the Game's input event handler. Default is true.
+ consumeEvents = <bool> // Whether the label propagates input events to the Game's input event handler. Default is true.
}
@endverbatim
*/
View
2 gameplay/src/Logger.cpp
@@ -29,7 +29,7 @@ void Logger::log(Level level, const char* message, ...)
va_start(args, message);
// Declare a moderately sized buffer on the stack that should be
- // large enough to accomodate most log requests.
+ // large enough to accommodate most log requests.
int size = 1024;
char stackBuffer[1024];
std::vector<char> dynamicBuffer;
View
2 gameplay/src/Matrix.h
@@ -129,7 +129,7 @@ class Matrix
* Creates a view matrix based on the specified input parameters.
*
* @param eyePosition The eye position.
- * @param targetPosition The target's cener position.
+ * @param targetPosition The target's center position.
* @param up The up vector.
* @param dst A matrix to store the result in.
*/
View
2 gameplay/src/Node.cpp
@@ -839,7 +839,7 @@ const BoundingSphere& Node::getBoundingSphere() const
// world matrix. This computes a final world matrix used for transforming this
// node's bounding volume. This allows us to store a much smaller bounding
// volume approximation than would otherwise be possible for skinned meshes,
- // since joint parent nodes that are not in the matrix pallette do not need to
+ // since joint parent nodes that are not in the matrix palette do not need to
// be considered as directly transforming vertices on the GPU (they can instead
// be applied directly to the bounding volume transformation below).
GP_ASSERT(_model->getSkin()->getRootJoint());
View
2 gameplay/src/Node.h
@@ -539,7 +539,7 @@ class Node : public Transform, public Ref
/**
* Sets the physics collision object for this node from the given properties object.
*
- * @param properties The properties object defining the collision ojbect.
+ * @param properties The properties object defining the collision object.
*/
PhysicsCollisionObject* setCollisionObject(Properties* properties);
View
6 gameplay/src/PhysicsCharacter.cpp
@@ -309,7 +309,7 @@ void PhysicsCharacter::stepUp(btCollisionWorld* collisionWorld, btScalar time)
if (_verticalVelocity.isZero())
{
- // Simply increase our poisiton by step height to enable us
+ // Simply increase our position by step height to enable us
// to smoothly move over steps.
targetPosition += btVector3(0, _stepHeight, 0);
}
@@ -521,7 +521,7 @@ static btVector3 parallelComponent(const btVector3& direction, const btVector3&
}
/*
- * Returns the portion of 'direction' that is perpindicular to 'normal'.
+ * Returns the portion of 'direction' that is perpendicular to 'normal'.
*/
static btVector3 perpindicularComponent(const btVector3& direction, const btVector3& normal)
{
@@ -572,7 +572,7 @@ bool PhysicsCharacter::fixCollision(btCollisionWorld* world)
_node->getWorldMatrix().getTranslation(&startPosition);
btVector3 currentPosition = BV(startPosition);
- // Handle all collisions/overlappign pairs.
+ // Handle all collisions/overlapping pairs.
btScalar maxPenetration = btScalar(0.0);
for (int i = 0, count = pairCache->getNumOverlappingPairs(); i < count; ++i)
{
View
2 gameplay/src/PhysicsCollisionObject.h
@@ -251,7 +251,7 @@ class PhysicsCollisionObject
ScriptListener(const char* url);
/**
- * @see PhysicsColliionObject::CollisionListener
+ * @see PhysicsCollisionObject::CollisionListener
*/
void collisionEvent(PhysicsCollisionObject::CollisionListener::EventType type, const PhysicsCollisionObject::CollisionPair& collisionPair,
const Vector3& contactPointA, const Vector3& contactPointB);
View
2 gameplay/src/PhysicsController.cpp
@@ -1027,7 +1027,7 @@ PhysicsCollisionShape* PhysicsController::createHeightfield(Node* node, Image* i
for (unsigned int y = 0, h = image->getHeight(); y < h; ++y)
{
//
- // Orignially in GamePlay this was normalizedHeightGrayscale which generally yielded
+ // Originally in GamePlay this was normalizedHeightGrayscale which generally yielded
// only 8-bit precision. This has been replaced by normalizedHeightPacked (with a
// corresponding change in gameplay-encoder).
//
View
10 gameplay/src/PhysicsRigidBody.cpp
@@ -43,6 +43,8 @@ PhysicsRigidBody::PhysicsRigidBody(Node* node, const PhysicsCollisionShape::Defi
// Set other initially defined properties.
setKinematic(parameters.kinematic);
setAnisotropicFriction(parameters.anisotropicFriction);
+ setAngularFactor(parameters.angularFactor);
+ setLinearFactor(parameters.linearFactor);
// Add ourself to the physics world.
Game::getInstance()->getPhysicsController()->addCollisionObject(this);
@@ -223,6 +225,14 @@ PhysicsRigidBody* PhysicsRigidBody::create(Node* node, Properties* properties, c
gravity = new Vector3();
properties->getVector3(NULL, gravity);
}
+ else if (strcmp(name, "angularFactor") == 0)
+ {
+ properties->getVector3(NULL, &parameters.angularFactor);
+ }
+ else if (strcmp(name, "linearFactor") == 0)
+ {
+ properties->getVector3(NULL, &parameters.linearFactor);
+ }
else
{
// Ignore this case (the attributes for the rigid body's collision shape would end up here).
View
75 gameplay/src/PhysicsRigidBody.h
@@ -74,11 +74,25 @@ class PhysicsRigidBody : public PhysicsCollisionObject, public Transform::Listen
Vector3 anisotropicFriction;
/**
+ * Linear factor for the rigid body. x, y, z coordinates correspond to world
+ * space motion along these axes. Use 1.0 to allow or 0.0 to disallow motion
+ * along certain axis.
+ */
+ Vector3 linearFactor;
+
+ /**
+ * Angular factor for the rigid body. x, y, z coordinates correspond to world
+ * space rotation along these axes. Use 1.0 to allow or 0.0 to disallow rotation
+ * along certain axis.
+ */
+ Vector3 angularFactor;
+
+ /**
* Constructor.
*/
Parameters() : mass(0.0f), friction(0.5f), restitution(0.0f),
linearDamping(0.0f), angularDamping(0.0f),
- kinematic(false), anisotropicFriction(Vector3::one())
+ kinematic(false), anisotropicFriction(Vector3::one()), linearFactor(Vector3::one()), angularFactor(Vector3::one())
{
}
@@ -87,9 +101,10 @@ class PhysicsRigidBody : public PhysicsCollisionObject, public Transform::Listen
*/
Parameters(float mass, float friction = 0.5f, float resititution = 0.0f,
float linearDamping = 0.0f, float angularDamping = 0.0f, bool kinematic = false,
- const Vector3& anisotropicFriction = Vector3::one())
+ const Vector3& anisotropicFriction = Vector3::one(), const Vector3& linearFactor = Vector3::one(),
+ const Vector3& angularFactor = Vector3::one())
: mass(mass), friction(friction), restitution(restitution), linearDamping(linearDamping), angularDamping(angularDamping),
- kinematic(kinematic), anisotropicFriction(anisotropicFriction)
+ kinematic(kinematic), anisotropicFriction(anisotropicFriction), linearFactor(linearFactor), angularFactor(angularFactor)
{
}
};
@@ -250,6 +265,60 @@ class PhysicsRigidBody : public PhysicsCollisionObject, public Transform::Listen
inline void setGravity(float x, float y, float z);
/**
+ * Gets the rigid body's angular factor.
+ *
+ * @return The angular factor.
+ */
+ inline Vector3 getAngularFactor() const;
+
+ /**
+ * Sets the rigid body's angular factor. x, y, z coordinates correspond to world
+ * space rotation along these axes. Use 1.0 to allow or 0.0 to disallow rotation
+ * along certain axis.
+ *
+ * @param angularFactor angular factor vector
+ */
+ inline void setAngularFactor(const Vector3& angularFactor);
+
+ /**
+ * Sets the rigid body's angular factor. x, y, z coordinates correspond to world
+ * space rotation along these axes. Use 1.0 to allow or 0.0 to disallow rotation
+ * along certain axis.
+ *
+ * @param x The x coordinate of the angular factor vector.
+ * @param y The y coordinate of the angular factor vector.
+ * @param z The z coordinate of the angular factor vector.
+ */
+ inline void setAngularFactor(float x, float y, float z);
+
+ /**
+ * Gets the rigid body's linear factor.
+ *
+ * @return The linear factor.
+ */
+ inline Vector3 getLinearFactor() const;
+
+ /**
+ * Sets the rigid body's linear factor. x, y, z coordinates correspond to world
+ * space motion along these axes. Use 1.0 to allow or 0.0 to disallow motion
+ * along certain axis.
+ *
+ * @param linearFactor linear factor vector
+ */
+ inline void setLinearFactor(const Vector3& linearFactor);
+
+ /**
+ * Sets the rigid body's linear factor. x, y, z coordinates correspond to world
+ * space motion along these axes. Use 1.0 to allow or 0.0 to disallow motion
+ * along certain axis.
+ *
+ * @param x The x coordinate of the linear factor vector.
+ * @param y The y coordinate of the linear factor vector.
+ * @param z The z coordinate of the linear factor vector.
+ */
+ inline void setLinearFactor(float x, float y, float z);
+
+ /**
* Sets whether the rigid body is a kinematic rigid body or not.
*
* @param kinematic Whether the rigid body is kinematic or not.
View
38 gameplay/src/PhysicsRigidBody.inl
@@ -127,6 +127,44 @@ inline void PhysicsRigidBody::setGravity(float x, float y, float z)
_body->setGravity(btVector3(x, y, z));
}
+inline Vector3 PhysicsRigidBody::getAngularFactor() const
+{
+ GP_ASSERT(_body);
+ const btVector3& f = _body->getAngularFactor();
+ return Vector3(f.x(), f.y(), f.z());
+}
+
+inline void PhysicsRigidBody::setAngularFactor(const Vector3& angularFactor)
+{
+ GP_ASSERT(_body);
+ _body->setAngularFactor(BV(angularFactor));
+}
+
+inline void PhysicsRigidBody::setAngularFactor(float x, float y, float z)
+{
+ GP_ASSERT(_body);
+ _body->setAngularFactor(btVector3(x, y, z));
+}
+
+inline Vector3 PhysicsRigidBody::getLinearFactor() const
+{
+ GP_ASSERT(_body);
+ const btVector3& f = _body->getLinearFactor();
+ return Vector3(f.x(), f.y(), f.z());
+}
+
+inline void PhysicsRigidBody::setLinearFactor(const Vector3& angularFactor)
+{
+ GP_ASSERT(_body);
+ _body->setLinearFactor(BV(angularFactor));
+}
+
+inline void PhysicsRigidBody::setLinearFactor(float x, float y, float z)
+{
+ GP_ASSERT(_body);
+ _body->setLinearFactor(btVector3(x, y, z));
+}
+
inline bool PhysicsRigidBody::isStatic() const
{
GP_ASSERT(_body);
View
2 gameplay/src/PhysicsVehicleWheel.h
@@ -326,7 +326,7 @@ class PhysicsVehicleWheel : public PhysicsCollisionObject
/**
* Traverse up the visual scene graph. Upon finding the first ancestor node with an
- * advertised descendant of collsion type VEHICLE, add this wheel onto the vehicle.
+ * advertised descendant of collision type VEHICLE, add this wheel onto the vehicle.
*/
// Note: Currently this method is silent on failure to find a host.
void findAncestorAndBind();
View
15 gameplay/src/PlatformBlackBerry.cpp
@@ -566,8 +566,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
sensor_request_events(SENSOR_TYPE_AZIMUTH_PITCH_ROLL);
navigator_request_events(0);
navigator_rotation_lock(true);
- orientation_direction_t direction;
- orientation_get(&direction, &__orientationAngle);
+ __orientationAngle = atoi(getenv("ORIENTATION"));
int rc = 0;
int screenFormat = SCREEN_FORMAT_RGBA8888;
@@ -636,7 +635,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
goto error;
}
- // Set/get any window prooperties.
+ // Set/get any window properties.
rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_FORMAT, &screenFormat);
if (rc)
{
@@ -658,8 +657,6 @@ Platform* Platform::create(Game* game, void* attachToWindow)
}
else
{
- int angle = atoi(getenv("ORIENTATION"));
-
screen_display_t screen_display;
rc = screen_get_window_property_pv(__screenWindow, SCREEN_PROPERTY_DISPLAY, (void **)&screen_display);
if (rc)
@@ -687,7 +684,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
__screenWindowSize[0] = size[0];
__screenWindowSize[1] = size[1];
- if ((angle == 0) || (angle == 180))
+ if ((__orientationAngle == 0) || (__orientationAngle == 180))
{
if (((screen_mode.width > screen_mode.height) && (size[0] < size[1])) ||
((screen_mode.width < screen_mode.height) && (size[0] > size[1])))
@@ -696,7 +693,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
__screenWindowSize[0] = size[1];
}
}
- else if ((angle == 90) || (angle == 270))
+ else if ((__orientationAngle == 90) || (__orientationAngle == 270))
{
if (((screen_mode.width > screen_mode.height) && (size[0] > size[1])) ||
((screen_mode.width < screen_mode.height) && (size[0] < size[1])))
@@ -712,7 +709,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
}
- rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_ROTATION, &angle);
+ rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_ROTATION, &__orientationAngle);
if (rc)
{
perror("screen_set_window_property_iv(SCREEN_PROPERTY_ROTATION)");
@@ -1316,7 +1313,7 @@ bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheel
bool Platform::isGestureSupported(Gesture::GestureEvent evt)
{
- // All are supported no need to test th bitset
+ // All are supported no need to test the bitset
return true;
}
View
2 gameplay/src/Quaternion.cpp
@@ -389,7 +389,7 @@ void Quaternion::slerpForSquad(const Quaternion& q1, const Quaternion& q2, float
// cos(omega) = q1 * q2;
// slerp(q1, q2, t) = (q1*sin((1-t)*omega) + q2*sin(t*omega))/sin(omega);
// q1 = +- q2, slerp(q1,q2,t) = q1.
- // This is a straight-foward implementation of the formula of slerp. It does not do any sign switching.
+ // This is a straight-forward implementation of the formula of slerp. It does not do any sign switching.
float c = q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w;
if (fabs(c) >= 1.0f)
View
2 gameplay/src/RadioButton.h
@@ -30,7 +30,7 @@ namespace gameplay
text = <string>
group = <string>
iconSize = <width, height> // The size to draw the radio button icon, if different from its size in the texture.
- consumeEvents = <bool> // Whether the radio button propogates input events to the Game's input event handler. Default is true.
+ consumeEvents = <bool> // Whether the radio button propagates input events to the Game's input event handler. Default is true.
}
@endverbatim
*/
View
2 gameplay/src/RenderState.cpp
@@ -481,7 +481,7 @@ void RenderState::StateBlock::enableDepthWrite()
GP_ASSERT(_defaultState);
// Internal method used by Game::clear() to restore depth writing before a
- // clear operation. This is neccessary if the last code to draw before the
+ // clear operation. This is necessary if the last code to draw before the
// next frame leaves depth writing disabled.
if (!_defaultState->_depthWriteEnabled)
{
View
2 gameplay/src/ScriptController.cpp
@@ -550,6 +550,7 @@ static const char* lua_loadfile_function =
" local oldLoadfile = loadfile\n"
" loadfile = function(filename)\n"
" if filename ~= nil and not FileSystem.isAbsolutePath(filename) then\n"
+ " FileSystem.createFileFromAsset(filename)\n"
" filename = FileSystem.getResourcePath() .. filename\n"
" end\n"
" return oldLoadfile(filename)\n"
@@ -561,6 +562,7 @@ static const char* lua_dofile_function =
" local oldDofile = dofile\n"
" dofile = function(filename)\n"
" if filename ~= nil and not FileSystem.isAbsolutePath(filename) then\n"
+ " FileSystem.createFileFromAsset(filename)\n"
" filename = FileSystem.getResourcePath() .. filename\n"
" end\n"
" return oldDofile(filename)\n"
View
2 gameplay/src/ScriptController.h
@@ -81,7 +81,7 @@ class LuaArray
operator T* () const;
/**
- * Overloades [] operator to get/set item value at index.
+ * Overloads [] operator to get/set item value at index.
*/
T& operator[] (int index);
View
2 gameplay/src/Slider.h
@@ -25,7 +25,7 @@ namespace gameplay
value = <float> // The default position of the marker.
step = <float> // If greater than 0, force the marker to snap to discrete multiples of 'step'.
text = <string> // Text to display above, below or alongside the slider (depending on the style).
- consumeEvents = <bool> // Whether the slider propogates input events to the Game's input event handler. Default is true.
+ consumeEvents = <bool> // Whether the slider propagates input events to the Game's input event handler. Default is true.
// TODO: orientation = <HORIZONTAL or VERTICAL> // Determines whether a slider is stretched along its width or its height
}
@endverbatim
View
37 gameplay/src/lua/lua_FileSystem.cpp
@@ -16,6 +16,7 @@ void luaRegister_FileSystem()
};
const luaL_Reg lua_statics[] =
{
+ {"createFileFromAsset", lua_FileSystem_static_createFileFromAsset},
{"fileExists", lua_FileSystem_static_fileExists},
{"getResourcePath", lua_FileSystem_static_getResourcePath},
{"isAbsolutePath", lua_FileSystem_static_isAbsolutePath},
@@ -77,6 +78,42 @@ int lua_FileSystem__gc(lua_State* state)
return 0;
}
+int lua_FileSystem_static_createFileFromAsset(lua_State* state)
+{
+ // Get the number of parameters.
+ int paramCount = lua_gettop(state);
+
+ // Attempt to match the parameters to a valid binding.
+ switch (paramCount)
+ {
+ case 1:
+ {
+ if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
+ {
+ // Get parameter 1 off the stack.
+ ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(1, false);
+
+ FileSystem::createFileFromAsset(param1);
+
+ return 0;
+ }
+ else
+ {
+ lua_pushstring(state, "lua_FileSystem_static_createFileFromAsset - Failed to match the given parameters to a valid function signature.");
+ lua_error(state);
+ }
+ break;
+ }
+ default:
+ {
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
+ lua_error(state);
+ break;
+ }
+ }
+ return 0;
+}
+
int lua_FileSystem_static_fileExists(lua_State* state)
{
// Get the number of parameters.
View
1 gameplay/src/lua/lua_FileSystem.h
@@ -6,6 +6,7 @@ namespace gameplay
// Lua bindings for FileSystem.
int lua_FileSystem__gc(lua_State* state);
+int lua_FileSystem_static_createFileFromAsset(lua_State* state);
int lua_FileSystem_static_fileExists(lua_State* state);
int lua_FileSystem_static_getResourcePath(lua_State* state);
int lua_FileSystem_static_isAbsolutePath(lua_State* state);
View
229 gameplay/src/lua/lua_PhysicsRigidBody.cpp
@@ -33,13 +33,15 @@ void luaRegister_PhysicsRigidBody()
{"applyTorqueImpulse", lua_PhysicsRigidBody_applyTorqueImpulse},
{"collidesWith", lua_PhysicsRigidBody_collidesWith},
{"getAngularDamping", lua_PhysicsRigidBody_getAngularDamping},
+ {"getAngularFactor", lua_PhysicsRigidBody_getAngularFactor},
{"getAngularVelocity", lua_PhysicsRigidBody_getAngularVelocity},
{"getAnisotropicFriction", lua_PhysicsRigidBody_getAnisotropicFriction},
{"getCollisionShape", lua_PhysicsRigidBody_getCollisionShape},
{"getFriction", lua_PhysicsRigidBody_getFriction},
{"getGravity", lua_PhysicsRigidBody_getGravity},
{"getHeight", lua_PhysicsRigidBody_getHeight},
{"getLinearDamping", lua_PhysicsRigidBody_getLinearDamping},
+ {"getLinearFactor", lua_PhysicsRigidBody_getLinearFactor},
{"getLinearVelocity", lua_PhysicsRigidBody_getLinearVelocity},
{"getMass", lua_PhysicsRigidBody_getMass},
{"getNode", lua_PhysicsRigidBody_getNode},
@@ -51,13 +53,15 @@ void luaRegister_PhysicsRigidBody()
{"isKinematic", lua_PhysicsRigidBody_isKinematic},
{"isStatic", lua_PhysicsRigidBody_isStatic},
{"removeCollisionListener", lua_PhysicsRigidBody_removeCollisionListener},
+ {"setAngularFactor", lua_PhysicsRigidBody_setAngularFactor},
{"setAngularVelocity", lua_PhysicsRigidBody_setAngularVelocity},
{"setAnisotropicFriction", lua_PhysicsRigidBody_setAnisotropicFriction},
{"setDamping", lua_PhysicsRigidBody_setDamping},
{"setEnabled", lua_PhysicsRigidBody_setEnabled},
{"setFriction", lua_PhysicsRigidBody_setFriction},
{"setGravity", lua_PhysicsRigidBody_setGravity},
{"setKinematic", lua_PhysicsRigidBody_setKinematic},
+ {"setLinearFactor", lua_PhysicsRigidBody_setLinearFactor},
{"setLinearVelocity", lua_PhysicsRigidBody_setLinearVelocity},
{"setRestitution", lua_PhysicsRigidBody_setRestitution},
{NULL, NULL}
@@ -441,6 +445,52 @@ int lua_PhysicsRigidBody_getAngularDamping(lua_State* state)
return 0;
}
+int lua_PhysicsRigidBody_getAngularFactor(lua_State* state)
+{
+ // Get the number of parameters.
+ int paramCount = lua_gettop(state);
+
+ // Attempt to match the parameters to a valid binding.
+ switch (paramCount)
+ {
+ case 1:
+ {
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
+ {
+ PhysicsRigidBody* instance = getInstance(state);
+ void* returnPtr = (void*)new Vector3(instance->getAngularFactor());
+ if (returnPtr)
+ {
+ ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+ object->instance = returnPtr;
+ object->owns = true;
+ luaL_getmetatable(state, "Vector3");
+ lua_setmetatable(state, -2);
+ }
+ else
+ {
+ lua_pushnil(state);
+ }
+
+ return 1;
+ }
+ else
+ {
+ lua_pushstring(state, "lua_PhysicsRigidBody_getAngularFactor - Failed to match the given parameters to a valid function signature.");
+ lua_error(state);
+ }
+ break;
+ }
+ default:
+ {
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
+ lua_error(state);
+ break;
+ }
+ }
+ return 0;
+}
+
int lua_PhysicsRigidBody_getAngularVelocity(lua_State* state)
{
// Get the number of parameters.
@@ -775,6 +825,53 @@ int lua_PhysicsRigidBody_getLinearDamping(lua_State* state)
return 0;
}
+int lua_PhysicsRigidBody_getLinearFactor(lua_State* state)
+{
+ // Get the number of parameters.
+ int paramCount = lua_gettop(state);
+
+ // Attempt to match the parameters to a valid binding.
+ switch (paramCount)
+ {
+ case 1:
+ {
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
+ {
+ PhysicsRigidBody* instance = getInstance(state);
+ void* returnPtr = (void*)new Vector3(instance->getLinearFactor());
+ if (returnPtr)
+ {
+ ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+ object->instance = returnPtr;
+ object->owns = true;
+ luaL_getmetatable(state, "Vector3");
+ lua_setmetatable(state, -2);
+ }
+ else
+ {
+ lua_pushnil(state);
+ }
+
+ return 1;
+ }
+ else
+ {
+ lua_pushstring(state, "lua_PhysicsRigidBody_getLinearFactor - Failed to match the given parameters to a valid function signature.");
+ lua_error(state);