Browse Source

Adds map/unmap buffer for Mesh and MeshPart

seanpaultaylor 10 years ago
parent
commit
ac5903187e

+ 5 - 5
gameplay/gameplay.pro

@@ -9,8 +9,7 @@ TEMPLATE = lib
 CONFIG += staticlib
 CONFIG += c++11
 CONFIG -= qt
-
-#DEFINES += GP_NO_PLATFORM
+CONFIG(debug, debug|release): DEFINES += _DEBUG
 
 SOURCES += src/AbsoluteLayout.cpp \
     src/AIAgent.cpp \
@@ -548,18 +547,19 @@ linux: INCLUDEPATH += /usr/include/harfbuzz
 
 macx: OBJECTIVE_SOURCES += src/PlatformMacOSX.mm
 macx: OBJECTIVE_SOURCES += src/gameplay-main-macosx.mm
-macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
-macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64
+macx: QMAKE_CXXFLAGS += -x c++ -x objective-c++ -stdlib=libc++ -w -arch x86_64
 macx: LIBS += -F/System/Library/Frameworks -framework GameKit
 macx: LIBS += -F/System/Library/Frameworks -framework IOKit
 macx: LIBS += -F/System/Library/Frameworks -framework QuartzCore
 macx: LIBS += -F/System/Library/Frameworks -framework OpenAL
 macx: LIBS += -F/System/Library/Frameworks -framework OpenGL
 macx: LIBS += -F/System/Library/Frameworks -framework Cocoa
+macx: LIBS += -F/System/Library/Frameworks -framework Foundation
 
 win32: SOURCES += src/PlatformWindows.cpp
 win32: SOURCES += src/gameplay-main-windows.cpp
 win32: DEFINES += WIN32 _UNICODE UNICODE
-win32: INCLUDEPATH += $$(DXSDK_DIR)Include
+win32: INCLUDEPATH += $$(DXSDK_DIR)/Include
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302

+ 13 - 2
gameplay/src/Mesh.cpp

@@ -251,7 +251,6 @@ bool Mesh::isDynamic() const
     return _dynamic;
 }
 
-
 Mesh::PrimitiveType Mesh::getPrimitiveType() const
 {
     return _primitiveType;
@@ -262,7 +261,19 @@ void Mesh::setPrimitiveType(PrimitiveType type)
     _primitiveType = type;
 }
 
-void Mesh::setVertexData(const float* vertexData, unsigned int vertexStart, unsigned int vertexCount)
+void* Mesh::mapVertexBuffer(MapAccess access)
+{
+    GL_ASSERT( glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer) );
+
+    return (void*)glMapBuffer(GL_ARRAY_BUFFER, access);
+}
+
+bool Mesh::unmapVertexBuffer()
+{
+    return glUnmapBuffer(GL_ARRAY_BUFFER);
+}
+
+void Mesh::setVertexData(const void* vertexData, unsigned int vertexStart, unsigned int vertexCount)
 {
     GL_ASSERT( glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer) );
 

+ 44 - 1
gameplay/src/Mesh.h

@@ -47,6 +47,16 @@ public:
         POINTS = GL_POINTS
     };
 
+    /**
+     * Defines mapping access/usage.
+     */
+    enum MapAccess
+    {
+        MAP_READ_ONLY = GL_READ_ONLY,
+        MAP_WRITE_ONLY = GL_WRITE_ONLY,
+        MAP_READ_WRITE = GL_READ_WRITE
+    };
+
     /**
      * Constructs a new mesh with the specified vertex format.
      *
@@ -200,6 +210,39 @@ public:
      */
     void setPrimitiveType(Mesh::PrimitiveType type);
 
+    /**
+     * Maps the vertex buffer for the specified access.
+     *
+     * Mapping vertex data causes a synchronizing issue. To avoid gpu idle
+     * If GPU is still working with the buffer object, mapVertexBuffer will not
+     * return until GPU finishes its job with the corresponding buffer object.
+     *
+     * To avoid waiting (idle), you can call first setVertexBuffer with NULL pointer,
+     * then call mapVertexBuffer(). In this case, the previous data will be discarded
+     * and mapVertexBuffer() returns a new allocated pointer immediately even if GPU is
+     * still working with the previous data.
+     *
+     * However, this method is valid only if you want to update entire data set because
+     * you discard the previous data. If you want to change only portion of data or to
+     * read data, you better not release the previous data.
+     *
+     * After modifying the data of VBO, it must be unmapped the buffer object from the client's
+     * memory. unmapVertexBuffer returns true if success. When it returns false, the contents of
+     * vertex buffer become corrupted while the buffer was mapped. The corruption results from screen
+     * resolution change or window system specific events. In this case, the data must be resubmitted.
+     *
+     * @param access The access for which the data can be use. Ex. read, write, read_write.
+     * @return The mapped vertex buffer
+     */
+    void* mapVertexBuffer(Mesh::MapAccess access);
+
+    /**
+     * Unmaps the vertex buffer.
+     *
+     * @return false if unmapping buffer was unsuccessful
+     */
+    bool unmapVertexBuffer();
+
     /**
      * Sets the specified vertex data into the mapped vertex buffer.
      *
@@ -207,7 +250,7 @@ public:
      * @param vertexStart The index of the starting vertex (0 by default).
      * @param vertexCount The number of vertices to be set (default is 0, for all vertices).
      */
-    void setVertexData(const float* vertexData, unsigned int vertexStart = 0, unsigned int vertexCount = 0);
+    void setVertexData(const void* vertexData, unsigned int vertexStart = 0, unsigned int vertexCount = 0);
 
     /**
      * Creates and adds a new part of primitive data defining how the vertices are connected.

+ 14 - 2
gameplay/src/MeshPart.cpp

@@ -82,9 +82,16 @@ IndexBufferHandle MeshPart::getIndexBuffer() const
     return _indexBuffer;
 }
 
-bool MeshPart::isDynamic() const
+void* MeshPart::mapIndexBuffer(Mesh::MapAccess access)
 {
-    return _dynamic;
+    GL_ASSERT( glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer) );
+
+    return (void*)glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, access);
+}
+
+bool MeshPart::unmapIndexBuffer()
+{
+    return glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
 }
 
 void MeshPart::setIndexData(const void* indexData, unsigned int indexStart, unsigned int indexCount)
@@ -123,4 +130,9 @@ void MeshPart::setIndexData(const void* indexData, unsigned int indexStart, unsi
     }
 }
 
+bool MeshPart::isDynamic() const
+{
+    return _dynamic;
+}
+
 }

+ 36 - 3
gameplay/src/MeshPart.h

@@ -58,11 +58,37 @@ public:
     IndexBufferHandle getIndexBuffer() const;
 
     /**
-     * Determines if the indices are dynamic.
+     * Maps the index buffer for the specified access.
      *
-     * @return true if the part is dynamic; false otherwise.
+     * Mapping index data causes a synchronizing issue. To avoid gpu idle
+     * If GPU is still working with the buffer object, mapIndexBuffer will not
+     * return until GPU finishes its job with the corresponding buffer object.
+     *
+     * To avoid waiting (idle), you can call first setIndexData with NULL pointer,
+     * then call mapIndexBuffer(). In this case, the previous data will be discarded
+     * and mapIndexData() returns a new allocated pointer immediately even if GPU is
+     * still working with the previous data.
+     *
+     * However, this method is valid only if you want to update entire data set because
+     * you discard the previous data. If you want to change only portion of data or to
+     * read data, you better not release the previous data.
+     *
+     * After modifying the data of VBO, it must be unmapped the buffer object from the client's
+     * memory. unmapIndexBuffer returns true if success. When it returns false, the contents of
+     * index buffer become corrupted while the buffer was mapped. The corruption results from screen
+     * resolution change or window system specific events. In this case, the data must be resubmitted.
+     *
+     * @param access The access for which the data can be use. Ex. read, write, read_write.
+     * @return The mapped index buffer
      */
-    bool isDynamic() const;
+    void* mapIndexBuffer(Mesh::MapAccess access);
+
+    /**
+     * Unmaps the index buffer.
+     *
+     * @return false if unmapping buffer was unsuccessful
+     */
+    bool unmapIndexBuffer();
 
     /**
      * Sets the specified index data into the mapped index buffer.
@@ -74,6 +100,13 @@ public:
      */
     void setIndexData(const void* indexData, unsigned int indexStart, unsigned int indexCount);
 
+    /**
+     * Determines if the indices are dynamic.
+     *
+     * @return true if the part is dynamic; false otherwise.
+     */
+    bool isDynamic() const;
+
 private:
 
     /**

+ 12 - 11
gameplay/src/Properties.h

@@ -524,11 +524,13 @@ private:
     Properties();
 
     /**
-     * Constructs the Properties class from a file.
-     *
-     * @param stream The stream used for reading the properties from file.
+     * Constructor.
      */
     Properties(Stream* stream);
+
+    /**
+     * Constructor.
+     */
     Properties(const Properties& copy);
 
     /**
@@ -538,21 +540,20 @@ private:
 
     void readProperties(Stream* stream);
 
+    void setDirectoryPath(const std::string* path);
+
+    void setDirectoryPath(const std::string& path);
+
     void skipWhiteSpace(Stream* stream);
 
     char* trimWhiteSpace(char* str);
 
-    // Called after create(); copies info from parents into derived namespaces.
-    void resolveInheritance(const char* id = NULL);
+    Properties* clone();
 
-    // Called by resolveInheritance().
     void mergeWith(Properties* overrides);
 
-    // Clones the Properties object.
-    Properties* clone();
-
-    void setDirectoryPath(const std::string* path);
-    void setDirectoryPath(const std::string& path);
+    // Called after create(); copies info from parents into derived namespaces.
+    void resolveInheritance(const char* id = NULL);
 
     std::string _namespace;
     std::string _id;

+ 4 - 2
samples/browser/sample-browser.pro

@@ -8,6 +8,7 @@ TARGET = sample-browser
 TEMPLATE = app
 CONFIG += c++11
 CONFIG -= qt
+CONFIG(debug, debug|release): DEFINES += _DEBUG
 
 SOURCES += src/Audio3DSample.cpp \
     src/AudioSample.cpp \
@@ -89,8 +90,7 @@ linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ..
 linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$$escape_expand(\n\t))
 linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
 
-macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
-macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64
+macx: QMAKE_CXXFLAGS += -x c++ -x objective-c++ -stdlib=libc++ -w -arch x86_64
 macx: LIBS += -L$$PWD/../../gameplay/Debug/ -lgameplay
 macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lgameplay-deps
 macx: LIBS += -F/System/Library/Frameworks -framework GameKit
@@ -99,6 +99,7 @@ macx: LIBS += -F/System/Library/Frameworks -framework QuartzCore
 macx: LIBS += -F/System/Library/Frameworks -framework OpenAL
 macx: LIBS += -F/System/Library/Frameworks -framework OpenGL
 macx: LIBS += -F/System/Library/Frameworks -framework Cocoa
+macx: LIBS += -F/System/Library/Frameworks -framework Foundation
 macx: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
@@ -128,6 +129,7 @@ win32: LIBS += -L$$(DXSDK_DIR)Lib\x64 -lXInput
 win32: INCLUDEPATH += $$(DXSDK_DIR)Include
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\shaders res\shaders\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\ui res\ui\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(copy ..\..\..\gameplay\res\logo_powered_white.png res$$escape_expand(\n\t))

+ 1 - 1
samples/browser/src/GestureSample.cpp

@@ -60,7 +60,7 @@ void GestureSample::initialize()
         registerGesture(Gesture::GESTURE_DROP);
         GP_ASSERT(isGestureRegistered(Gesture::GESTURE_DROP));
 	}
-    GP_ASSERT(anySupported == isGestureSupported(Gesture::GESTURE_ANY_SUPPORTED));
+    //GP_ASSERT(anySupported == isGestureSupported(Gesture::GESTURE_ANY_SUPPORTED));
 }
 
 void GestureSample::finalize()

+ 5 - 3
samples/character/sample-character.pro

@@ -8,6 +8,7 @@ TARGET = sample-character
 TEMPLATE = app
 CONFIG += c++11
 CONFIG -= qt
+CONFIG(debug, debug|release): DEFINES += _DEBUG
 
 SOURCES += src/CharacterGame.cpp
 
@@ -40,8 +41,7 @@ linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$
 linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
 linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/game.dxt.config game.config$$escape_expand(\n\t))
 
-macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
-macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64
+macx: QMAKE_CXXFLAGS += -x c++  -x objective-c++ -stdlib=libc++ -w -arch x86_64
 macx: LIBS += -L$$PWD/../../gameplay/Debug/ -lgameplay
 macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lgameplay-deps
 macx: LIBS += -F/System/Library/Frameworks -framework GameKit
@@ -50,7 +50,8 @@ macx: LIBS += -F/System/Library/Frameworks -framework QuartzCore
 macx: LIBS += -F/System/Library/Frameworks -framework OpenAL
 macx: LIBS += -F/System/Library/Frameworks -framework OpenGL
 macx: LIBS += -F/System/Library/Frameworks -framework Cocoa
-macx: QMAKE_ += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ../res$$escape_expand(\n\t))
+macx: LIBS += -F/System/Library/Frameworks -framework Foundation
+macx: QMAKE_POST_LINK  += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
 macx
@@ -78,6 +79,7 @@ win32: LIBS += -L$$(DXSDK_DIR)Lib\x64 -lXInput
 win32: INCLUDEPATH += $$(DXSDK_DIR)Include
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\shaders res\shaders\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\ui res\ui\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(copy ..\..\..\gameplay\res\logo_powered_white.png res$$escape_expand(\n\t))

+ 4 - 2
samples/racer/sample-racer.pro

@@ -8,6 +8,7 @@ TARGET = sample-racer
 TEMPLATE = app
 CONFIG += c++11
 CONFIG -= qt
+CONFIG(debug, debug|release): DEFINES += _DEBUG
 
 SOURCES += src/RacerGame.cpp
 
@@ -40,8 +41,7 @@ linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$
 linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
 linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/game.dxt.config game.config$$escape_expand(\n\t))
 
-macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
-macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64
+macx: QMAKE_CXXFLAGS += -x c++ -x objective-c++ -stdlib=libc++ -w -arch x86_64
 macx: LIBS += -L$$PWD/../../gameplay/Debug/ -lgameplay
 macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lgameplay-deps
 macx: LIBS += -F/System/Library/Frameworks -framework GameKit
@@ -50,6 +50,7 @@ macx: LIBS += -F/System/Library/Frameworks -framework QuartzCore
 macx: LIBS += -F/System/Library/Frameworks -framework OpenAL
 macx: LIBS += -F/System/Library/Frameworks -framework OpenGL
 macx: LIBS += -F/System/Library/Frameworks -framework Cocoa
+macx: LIBS += -F/System/Library/Frameworks -framework Foundation
 macx: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
@@ -78,6 +79,7 @@ win32: LIBS += -L$$(DXSDK_DIR)Lib\x64 -lXInput
 win32: INCLUDEPATH += $$(DXSDK_DIR)Include
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\shaders res\shaders\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\ui res\ui\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(copy ..\..\..\gameplay\res\logo_powered_white.png res$$escape_expand(\n\t))

+ 4 - 2
samples/spaceship/sample-spaceship.pro

@@ -8,6 +8,7 @@ TARGET = sample-spaceship
 TEMPLATE = app
 CONFIG += c++11
 CONFIG -= qt
+CONFIG(debug, debug|release): DEFINES += _DEBUG
 
 SOURCES += src/SpaceshipGame.cpp
 
@@ -39,8 +40,7 @@ linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ..
 linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$$escape_expand(\n\t))
 linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
 
-macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
-macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64
+macx: QMAKE_CXXFLAGS += -x c++  -x objective-c++ -stdlib=libc++ -w -arch x86_64
 macx: LIBS += -L$$PWD/../../gameplay/Debug/ -lgameplay
 macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lgameplay-deps
 macx: LIBS += -F/System/Library/Frameworks -framework GameKit
@@ -49,6 +49,7 @@ macx: LIBS += -F/System/Library/Frameworks -framework QuartzCore
 macx: LIBS += -F/System/Library/Frameworks -framework OpenAL
 macx: LIBS += -F/System/Library/Frameworks -framework OpenGL
 macx: LIBS += -F/System/Library/Frameworks -framework Cocoa
+macx: LIBS += -F/System/Library/Frameworks -framework Foundation
 macx: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$$escape_expand(\n\t))
 macx: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
@@ -77,6 +78,7 @@ win32: LIBS += -L$$(DXSDK_DIR)Lib\x64 -lXInput
 win32: INCLUDEPATH += $$(DXSDK_DIR)Include
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
 win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\shaders res\shaders\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(xcopy ..\..\..\gameplay\res\ui res\ui\* /s /y /d$$escape_expand(\n\t))
 win32: QMAKE_POST_LINK += $$quote(copy ..\..\..\gameplay\res\logo_powered_white.png res$$escape_expand(\n\t))

+ 29 - 17
tools/encoder/gameplay-encoder.pro

@@ -3,12 +3,11 @@
 # Project created by QtCreator
 #
 #-------------------------------------------------
-
 QT       -= core gui
-
 TARGET = gameplay-encoder
 CONFIG   += console
 CONFIG   -= app_bundle
+CONFIG(debug, debug|release): DEFINES += _DEBUG
 
 TEMPLATE = app
 
@@ -53,6 +52,8 @@ SOURCES += src/Mesh.cpp \
     src/StringUtil.cpp \
     src/Transform.cpp \
     src/TTFFontEncoder.cpp \
+    src/TMXSceneEncoder.cpp \
+    src/TMXTypes.cpp \
     src/Vector2.cpp \
     src/Vector3.cpp \
     src/Vector4.cpp \
@@ -103,6 +104,8 @@ HEADERS += src/AnimationChannel.h \
     src/Thread.h \
     src/Transform.h \
     src/TTFFontEncoder.h \
+    src/TMXSceneEncoder.h \
+    src/TMXTypes.h \
     src/Vector2.h \
     src/Vector2.inl \
     src/Vector3.h \
@@ -112,23 +115,32 @@ HEADERS += src/AnimationChannel.h \
     src/VertexElement.h \
     src/Vertex.h
 
+DEFINES += USE_FBX
 INCLUDEPATH += $$PWD/../../external-deps/include
-linux:!android: INCLUDEPATH += /usr/include/fbxsdk
-linux:!android: INCLUDEPATH += /usr/include
-
-DEPENDPATH += INCLUDEPATH
 
-linux:!android: DEFINES += USE_FBX
-linux:!android: DEFINES += __linux__
 
-linux:!android: QMAKE_CXXFLAGS += -std=c++11 -lstdc++ -pthread -w
+linux: DEFINES += __linux__
+linux: QMAKE_CXXFLAGS += -std=c++11 -lstdc++ -pthread -w
+linux: INCLUDEPATH += /usr/include/fbxsdk
+linux: INCLUDEPATH += /usr/include
+linux: LIBS += -L$$PWD/../../external-deps/lib/linux/x86_64/ -lgameplay-deps -lfreetype
+linux: LIBS += -L/usr/lib/gcc4/x64/release -lfbxsdk
+linux: LIBS += -lstdc++ -ldl -lpthread
 
-linux:!android: LIBS += -L$$PWD/../../external-deps/lib/linux/x86_64/ -lgameplay-deps -lfreetype
-linux:!android: LIBS += -L/usr/lib/gcc4/x64/release -lfbxsdk
-linux:!android: LIBS += -lstdc++
-linux:!android: LIBS += -ldl
-linux:!android: LIBS += -lpthread
+macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
+macx: INCLUDEPATH += "/Applications/Autodesk/FBX SDK/2015.1/include"
+macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lgameplay-deps
+macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lfreetype
+macx: LIBS += -L"/Applications/Autodesk/FBX SDK/2015.1/lib/clang/release/" -lfbxsdk-static
+macx: LIBS += -F/System/Library/Frameworks -framework Cocoa
+macx: LIBS += -F/System/Library/Frameworks -framework SystemConfiguration
+macx: LIBS += -F/System/Library/Frameworks -framework Foundation
+macx: LIBS += -lm -lbz2 -lxml2 -liconv
 
-linux:!android: PRE_TARGETDEPS += $$PWD/../../external-deps/lib/linux/x86_64/libgameplay-deps.a
-linux:!android: PRE_TARGETDEPS += $$PWD/../../external-deps/lib/linux/x86_64/libfreetype.a
-linux:!android: PRE_TARGETDEPS += /usr/lib/gcc4/x64/release/libfbxsdk.a
+win32: DEFINES += WIN32 _WINDOWS _UNICODE UNICODE
+win32: CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external-deps/lib/windows/x86_64/Debug/ -lgameplay-deps
+win32: CONFIG(release, debug|release): LIBS += -L$$PWD/../../external-deps/lib/windows/x86_64/Release/ -lgameplay-deps
+win32: LIBS += -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302

+ 16 - 12
tools/luagen/gameplay-luagen.pro

@@ -3,12 +3,11 @@
 # Project created by QtCreator
 #
 #-------------------------------------------------
-
 QT       -= core gui
-
 TARGET = gameplay-luagen
 CONFIG   += console
 CONFIG   -= app_bundle
+CONFIG(debug, debug|release): DEFINES += _DEBUG
 
 TEMPLATE = app
 
@@ -29,13 +28,18 @@ HEADERS += src/Base.h \
 
 INCLUDEPATH += $$PWD/../../external-deps/include
 
-DEPENDPATH += INCLUDEPATH
-
-linux:!android: DEFINES += __linux__
-
-linux:!android: QMAKE_CXXFLAGS += -std=c++11 -lstdc++ -pthread -w
-
-linux:!android: LIBS += -L$$PWD/../../external-deps/lib/linux/x86_64/ -lgameplay-deps
-linux:!android: LIBS += -lstdc++
-
-linux:!android: PRE_TARGETDEPS += $$PWD/../../external-deps/lib/linux/x86_64/libgameplay-deps.a
+linux: DEFINES += __linux__
+linux: QMAKE_CXXFLAGS += -std=c++11 -lstdc++ -pthread -w
+linux: LIBS += -L$$PWD/../../external-deps/lib/linux/x86_64/ -lgameplay-deps
+linux: LIBS += -lstdc++
+
+macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
+macx: LIBS += -L$$PWD/../../external-deps/lib/macosx/x86_64/ -lgameplay-deps
+
+win32: DEFINES += WIN32 _WINDOWS _UNICODE UNICODE
+win32: CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external-deps/lib/windows/x86_64/Debug/ -lgameplay-deps
+win32: CONFIG(release, debug|release): LIBS += -L$$PWD/../../external-deps/lib/windows/x86_64/Release/ -lgameplay-deps
+win32: LIBS += -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w34100
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w34189
+win32: QMAKE_CXXFLAGS_WARN_ON -= -w4302