Skip to content

Commit 4de92c4

Browse files
Merge branch 'next'
2 parents 5485fcf + fa9c37e commit 4de92c4

318 files changed

Lines changed: 14835 additions & 12645 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: cpp
2+
before_script:
3+
- ./install.sh
4+
- mkdir build
5+
- cd build
6+
- cmake ..
7+
script: make
8+
compiler:
9+
- gcc
10+
addons:
11+
apt:
12+
sources:
13+
- ubuntu-toolchain-r-test
14+
packages:
15+
- libglu1-mesa-dev
16+
- libogg-dev
17+
- libopenal-dev
18+
- lib32z1-dev
19+
- libgtk2.0-dev
20+
notifications:
21+
email: false
22+
sudo: required
23+
dist: trusty

CHANGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
## v3.0.0
32

43
- Adds support for Visual Studio 2015.
@@ -16,16 +15,20 @@
1615
- Adds support for cubemap textures.
1716
- Adds support for font kerning.
1817
- Adds support for Android x86.
18+
- Adds support for CMake on MacOSX.
1919
- Adds support for gamepads on Android.
2020
- Adds supoprt for Android extensions through custom native activity.
2121
- Adds water sample to browser.
2222
- Adds audio player sample to browser.
2323
- Adds GamePlay-deps repository for cross-platform Cmake dependency builds.
24+
- Adds map/unmap buffer for Mesh and MeshPart.
2425
- Fixes to Scene Graph for merging Drawables on Node.
2526
- Fixes from setUserPointer to setUserObject(Ref*)
2627
- Fixes for virtual gamepad scaling.
2728
- Fixes Image to support grayscale PNGs.
2829
- Fixes Android to build with arm instead of thumb.
30+
- Fixes Android crash when gamepads disconnected.
31+
- Fixes for lua script bindings.
2932

3033
## v2.0.0
3134

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ GamePlay is an open-source, cross-platform, C++ game framework/engine for creati
1717
- [iOS](https://github.com/gameplay3d/GamePlay/wiki/Xcode-Setup)
1818
- [Android](https://github.com/gameplay3d/GamePlay/wiki/Android-NDK-Setup)
1919

20-
## Roadmap for 'next' branch
21-
- [backlog](https://github.com/gameplay3d/GamePlay/issues?q=is%3Aopen+is%3Aissue+no%3Amilestone)
22-
2320
## License
2421
Open-source under [Apache 2.0 license](http://www.tldrlegal.com/license/apache-license-2.0-%28apache-2.0%29).
2522

gameplay/CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
2+
set(GAMEPLAY_PLATFORM_SRC
3+
src/PlatformMacOSX.mm
4+
src/gameplay-main-macosx.mm
5+
)
6+
else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
7+
set(GAMEPLAY_PLATFORM_SRC )
8+
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
19

210
set(GAMEPLAY_SRC
311
src/AbsoluteLayout.cpp
@@ -165,6 +173,7 @@ set(GAMEPLAY_SRC
165173
src/PlatformAndroid.cpp
166174
src/PlatformLinux.cpp
167175
src/PlatformWindows.cpp
176+
${GAMEPLAY_PLATFORM_SRC}
168177
src/Properties.cpp
169178
src/Properties.h
170179
src/Quaternion.cpp
@@ -555,8 +564,13 @@ add_definitions(${GTK2_CFLAGS_OTHER})
555564
add_definitions(-D__linux__)
556565
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
557566

558-
add_definitions(-std=c++11)
559-
add_definitions(-lstdc++)
567+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
568+
# using Clang
569+
add_definitions(-std=c++11 -stdlib=libc++)
570+
else()
571+
add_definitions(-std=c++11)
572+
add_definitions(-lstdc++)
573+
endif()
560574

561575
add_library(gameplay STATIC
562576
${GAMEPLAY_SRC}

gameplay/gameplay.pro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ TEMPLATE = lib
99
CONFIG += staticlib
1010
CONFIG += c++11
1111
CONFIG -= qt
12-
13-
#DEFINES += GP_NO_PLATFORM
12+
CONFIG(debug, debug|release): DEFINES += _DEBUG
1413

1514
SOURCES += src/AbsoluteLayout.cpp \
1615
src/AIAgent.cpp \
@@ -548,18 +547,19 @@ linux: INCLUDEPATH += /usr/include/harfbuzz
548547

549548
macx: OBJECTIVE_SOURCES += src/PlatformMacOSX.mm
550549
macx: OBJECTIVE_SOURCES += src/gameplay-main-macosx.mm
551-
macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
552-
macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64
550+
macx: QMAKE_CXXFLAGS += -x c++ -x objective-c++ -stdlib=libc++ -w -arch x86_64
553551
macx: LIBS += -F/System/Library/Frameworks -framework GameKit
554552
macx: LIBS += -F/System/Library/Frameworks -framework IOKit
555553
macx: LIBS += -F/System/Library/Frameworks -framework QuartzCore
556554
macx: LIBS += -F/System/Library/Frameworks -framework OpenAL
557555
macx: LIBS += -F/System/Library/Frameworks -framework OpenGL
558556
macx: LIBS += -F/System/Library/Frameworks -framework Cocoa
557+
macx: LIBS += -F/System/Library/Frameworks -framework Foundation
559558

560559
win32: SOURCES += src/PlatformWindows.cpp
561560
win32: SOURCES += src/gameplay-main-windows.cpp
562561
win32: DEFINES += WIN32 _UNICODE UNICODE
563-
win32: INCLUDEPATH += $$(DXSDK_DIR)Include
562+
win32: INCLUDEPATH += $$(DXSDK_DIR)/Include
564563
win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
565564
win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
565+
win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302

gameplay/src/Base.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <set>
2323
#include <stack>
2424
#include <map>
25+
#include <unordered_map>
2526
#include <queue>
2627
#include <algorithm>
2728
#include <limits>
@@ -116,7 +117,7 @@ extern int strcmpnocase(const char* s1, const char* s2);
116117
#pragma warning( disable : 4244 )
117118
#pragma warning( disable : 4267 )
118119
#pragma warning( disable : 4311 )
119-
#pragma warning( disable : 4316 )
120+
#pragma warning( disable : 4316 )
120121
#pragma warning( disable : 4390 )
121122
#pragma warning( disable : 4800 )
122123
#pragma warning( disable : 4996 )
@@ -217,6 +218,9 @@ using std::va_list;
217218
extern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays;
218219
extern PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays;
219220
extern PFNGLISVERTEXARRAYOESPROC glIsVertexArray;
221+
extern PFNGLMAPBUFFEROESPROC glMapBuffer;
222+
extern PFNGLUNMAPBUFFEROESPROC glUnmapBuffer;
223+
#define GL_WRITE_ONLY GL_WRITE_ONLY_OES
220224
#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
221225
#define glClearDepth glClearDepthf
222226
#define OPENGL_ES
@@ -239,6 +243,9 @@ using std::va_list;
239243
#define glDeleteVertexArrays glDeleteVertexArraysOES
240244
#define glGenVertexArrays glGenVertexArraysOES
241245
#define glIsVertexArray glIsVertexArrayOES
246+
#define glMapBuffer glMapBufferOES
247+
#define glUnmapBuffer glUnmapBufferOES
248+
#define GL_WRITE_ONLY GL_WRITE_ONLY_OES
242249
#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
243250
#define glClearDepth glClearDepthf
244251
#define OPENGL_ES

gameplay/src/DebugNew.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ extern void printMemoryLeaks();
2020
#endif
2121
void* operator new (std::size_t size, const char* file, int line);
2222
void* operator new[] (std::size_t size, const char* file, int line);
23+
#ifdef WIN32
2324
void* operator new (std::size_t size) throw(std::bad_alloc);
2425
void* operator new[] (std::size_t size) throw(std::bad_alloc);
26+
#endif
2527
void* operator new (std::size_t size, const std::nothrow_t&) throw();
2628
void* operator new[] (std::size_t size, const std::nothrow_t&) throw();
2729
void operator delete (void* p) throw();

gameplay/src/Joint.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ Node::Type Joint::getType() const
3535
return Node::JOINT;
3636
}
3737

38+
const char* Joint::getTypeName() const
39+
{
40+
return "Joint";
41+
}
42+
3843
Scene* Joint::getScene() const
3944
{
4045
// Overrides Node::getScene() to search the node our skins.

gameplay/src/Joint.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ class Joint : public Node
3434
*/
3535
Scene* getScene() const;
3636

37+
/**
38+
* Extends ScriptTarget::getTypeName() to return the type name of this class.
39+
*
40+
* @return The type name of this class: "Joint"
41+
* @see ScriptTarget::getTypeName()
42+
*/
43+
const char* getTypeName() const;
44+
3745
/**
3846
* Returns the inverse bind pose matrix for this joint.
3947
*

gameplay/src/Logger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void Logger::log(Level level, const char* message, ...)
6565
else if (state.logFunctionLua)
6666
{
6767
// Pass call to registered Lua log function
68-
Game::getInstance()->getScriptController()->executeFunction<void>(state.logFunctionLua, "[Logger::Level]s", level, str);
68+
Game::getInstance()->getScriptController()->executeFunction<void>(state.logFunctionLua, "[Logger::Level]s", NULL, level, str);
6969
}
7070
else
7171
{

0 commit comments

Comments
 (0)