diff --git a/.gitignore b/.gitignore index 49dfa0ec2..2fc0d3d53 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ *.xcuserdata *.orig +/Player/Build /Standalone/Build /Dependencies/Build /Dependencies/Downloads @@ -43,7 +44,6 @@ /IDE/Build/Mac\ OS\ X/build /Modules/Build/Mac\ OS\ X/build /Tools/Build/Mac\ OS\ X/build -/Player/Build/Mac\ OS\ X/build /Bindings/Build/Mac\ OS\ X/build /Core/Dependencies /Modules/Dependencies diff --git a/Assets/SamplePolyapp/main.polyapp b/Assets/SamplePolyapp/main.polyapp new file mode 100644 index 000000000..ac5a809ba Binary files /dev/null and b/Assets/SamplePolyapp/main.polyapp differ diff --git a/Bindings/Contents/LUA/CMakeLists.txt b/Bindings/Contents/LUA/CMakeLists.txt index 1bd299081..301c6afc3 100644 --- a/Bindings/Contents/LUA/CMakeLists.txt +++ b/Bindings/Contents/LUA/CMakeLists.txt @@ -1,6 +1,6 @@ INCLUDE(PolycodeIncludes) -FIND_PACKAGE(Lua51 REQUIRED) +FIND_PACKAGE(Lua REQUIRED) INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} diff --git a/CMake/FindLua.cmake b/CMake/FindLua.cmake new file mode 100644 index 000000000..5d05e679b --- /dev/null +++ b/CMake/FindLua.cmake @@ -0,0 +1,92 @@ + +SET(LUA_SEARCH_PATHS + ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/lib + ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/include + ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/include/lua5.1 + ${POLYCODE_RELEASE_DIR}/Framework/Modules/Dependencies/lib + ${POLYCODE_RELEASE_DIR}/Framework/Tools/Dependencies/lib +) + +SET(MSVC_YEAR_NAME) +IF (MSVC_VERSION GREATER 1599) # >= 1600 + SET(MSVC_YEAR_NAME VS2010) +ELSEIF(MSVC_VERSION GREATER 1499) # >= 1500 + SET(MSVC_YEAR_NAME VS2008) +ELSEIF(MSVC_VERSION GREATER 1399) # >= 1400 + SET(MSVC_YEAR_NAME VS2005) +ELSEIF(MSVC_VERSION GREATER 1299) # >= 1300 + SET(MSVC_YEAR_NAME VS2003) +ELSEIF(MSVC_VERSION GREATER 1199) # >= 1200 + SET(MSVC_YEAR_NAME VS6) +ENDIF() + +FIND_PATH(LUA_INCLUDE_DIR + NAMES lua.h + HINTS + $ENV{LUADIR} + $ENV{LUA_PATH} + PATH_SUFFIXES include include/lua5.1 lua5.1 + PATHS ${LUA_SEARCH_PATHS} +) + +FIND_LIBRARY(LUA_LIBRARY + NAMES lua5.1 liblua5.1 + HINTS + NO_DEFAULT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_PATH + CMAKE_FIND_FRAMEWORK NEVER + $ENV{LUADIR} + $ENV{LUA_PATH} + PATH_SUFFIXES lib lib64 win32/Dynamic_Release "Win32/${MSVC_YEAR_NAME}/x64/Release" "Win32/${MSVC_YEAR_NAME}/Win32/Release" + PATHS ${LUA_SEARCH_PATHS} +) + +# First search for d-suffixed libs +FIND_LIBRARY(LUA_LIBRARY_DEBUG + NAMES lua5.1d liblua5.1d + HINTS + NO_DEFAULT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_PATH + CMAKE_FIND_FRAMEWORK NEVER + $ENV{LUADIR} + $ENV{LUA_PATH} + PATH_SUFFIXES lib lib64 win32/Dynamic_Debug "Win32/${MSVC_YEAR_NAME}/x64/Debug" "Win32/${MSVC_YEAR_NAME}/Win32/Debug" + PATHS ${LUA_SEARCH_PATHS} +) + +IF(NOT LUA_LIBRARY_DEBUG) + # Then search for non suffixed libs if necessary, but only in debug dirs + FIND_LIBRARY(LUA_LIBRARY_DEBUG + NAMES lua liblua libliblua + HINTS + NO_DEFAULT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_PATH + CMAKE_FIND_FRAMEWORK NEVER + $ENV{LUADIR} + $ENV{LUA_PATH} + PATH_SUFFIXES win32/Dynamic_Debug "Win32/${MSVC_YEAR_NAME}/x64/Debug" "Win32/${MSVC_YEAR_NAME}/Win32/Debug" + PATHS ${LUA_SEARCH_PATHS} + ) +ENDIF() + + +IF(LUA_LIBRARY) + IF(LUA_LIBRARY_DEBUG) + SET(LUA_LIBRARIES optimized "${LUA_LIBRARY}" debug "${LUA_LIBRARY_DEBUG}") + ELSE() + SET(LUA_LIBRARIES "${LUA_LIBRARY}") # Could add "general" keyword, but it is optional + ENDIF() +ENDIF() + +# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LUA DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR) diff --git a/CMake/PolycodeIncludes.cmake b/CMake/PolycodeIncludes.cmake index f0f1d6b65..c52ec816b 100644 --- a/CMake/PolycodeIncludes.cmake +++ b/CMake/PolycodeIncludes.cmake @@ -19,6 +19,7 @@ FIND_PACKAGE(Freetype REQUIRED) FIND_PACKAGE(Ogg REQUIRED) FIND_PACKAGE(Vorbis REQUIRED) FIND_PACKAGE(VorbisFile REQUIRED) +FIND_PACKAGE(Lua REQUIRED) # Use SDL on non-Apple unixes IF(UNIX AND NOT APPLE) @@ -37,4 +38,5 @@ INCLUDE_DIRECTORIES( ${VORBISFILE_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${OPENGLEXT_INCLUDE_DIR} + ${LUA_INCLUDE_DIR} ) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9eae5e25..8c0e4409c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,9 +19,9 @@ ENDIF(NOT CMAKE_BUILD_TYPE) # Options for what components to build #OPTION(POLYCODE_BUILD_SHARED "Build Polycode shared libraries" OFF) #OPTION(POLYCODE_BUILD_STATIC "Build Polycode static libraries" ON) -#OPTION(POLYCODE_BUILD_BINDINGS "Build Polycode Lua bindings" ON) +OPTION(POLYCODE_BUILD_BINDINGS "Build Polycode Lua bindings" ON) OPTION(POLYCODE_BUILD_MODULES "Build Polycode modules" ON) -OPTION(POLYCODE_BUILD_PLAYER "Build Polycode standalone player" OFF) +OPTION(POLYCODE_BUILD_PLAYER "Build Polycode standalone player" ON) OPTION(POLYCODE_BUILD_TOOLS "Build Polycode tools" ON) OPTION(POLYCODE_BUILD_DOCS "Build Polycode documentation" ON) diff --git a/Modules/Bindings/2DPhysics/CMakeLists.txt b/Modules/Bindings/2DPhysics/CMakeLists.txt index ab385d9b0..0992c028f 100644 --- a/Modules/Bindings/2DPhysics/CMakeLists.txt +++ b/Modules/Bindings/2DPhysics/CMakeLists.txt @@ -7,20 +7,43 @@ INCLUDE_DIRECTORIES( ${BOX2D_INCLUDE_DIR} ${Polycode_SOURCE_DIR}/Modules/Contents/2DPhysics/Include Include + ../../Contents/2DPhysics/Include ) SET(polycode2DPhysics_SRCS Source/Physics2DLUA.cpp + ../../Contents/2DPhysics/Source/PolyPhysicsScreen.cpp + ../../Contents/2DPhysics/Source/PolyPhysicsScreenEntity.cpp ) SET(polycode2DPhysics_HDRS Include/Physics2DLUA.h Include/Physics2DLUAWrappers.h + ../../Contents/2DPhysics/Include/Polycode2DPhysics.h + ../../Contents/2DPhysics/Include/PolyPhysicsScreenEntity.h + ../../Contents/2DPhysics/Include/PolyPhysicsScreen.h ) -ADD_LIBRARY(Physics2D ${polycode2DPhysics_SRCS} ${polycode2DPhysics_HDRS}) +ADD_LIBRARY(Physics2D SHARED ${polycode2DPhysics_SRCS} ${polycode2DPhysics_HDRS}) SET(CMAKE_DEBUG_POSTFIX "_d") +SET_TARGET_PROPERTIES(Physics2D PROPERTIES PREFIX "") +TARGET_LINK_LIBRARIES(Physics2D + Polycore + ${LUA_LIBRARY} + ${BOX2D_RELEASE_LIBRARY} + "-framework Cocoa" + "-framework IOKit" + ${OPENGL_LIBRARIES} + ${OPENAL_LIBRARY} + ${PNG_LIBRARIES} + ${FREETYPE_LIBRARIES} + ${PHYSFS_LIBRARY} + ${OGG_LIBRARIES} + ${VORBIS_LIBRARIES} + ${VORBISFILE_LIBRARIES} + ${EXTRA_LIBS}) + IF(POLYCODE_INSTALL_FRAMEWORK) # install headers diff --git a/Modules/Bindings/3DPhysics/CMakeLists.txt b/Modules/Bindings/3DPhysics/CMakeLists.txt index 340b2cdad..324dab92e 100644 --- a/Modules/Bindings/3DPhysics/CMakeLists.txt +++ b/Modules/Bindings/3DPhysics/CMakeLists.txt @@ -1,27 +1,56 @@ INCLUDE(PolycodeIncludes) FIND_PACKAGE(Lua51 REQUIRED) +FIND_PACKAGE(Bullet REQUIRED) INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} ${BULLET_INCLUDE_DIR} ${Polycode_SOURCE_DIR}/Modules/Contents/3DPhysics/Include Include + ../../Contents/3DPhysics/Include ) SET(polycode3DPhysics_SRCS Source/Physics3DLUA.cpp + ../../Contents/3DPhysics/Source/PolyPhysicsSceneEntity.cpp + ../../Contents/3DPhysics/Source/PolyPhysicsScene.cpp + ../../Contents/3DPhysics/Source/PolyCollisionSceneEntity.cpp + ../../Contents/3DPhysics/Source/PolyCollisionScene.cpp ) SET(polycode3DPhysics_HDRS Include/Physics3DLUA.h Include/Physics3DLUAWrappers.h + ../../Contents/3DPhysics/Include/PolyPhysicsSceneEntity.h + ../../Contents/3DPhysics/Include/Polycode3DPhysics.h + ../../Contents/3DPhysics/Include/PolyCollisionScene.h + ../../Contents/3DPhysics/Include/PolyPhysicsScene.h + ../../Contents/3DPhysics/Include/PolyCollisionSceneEntity.h ) -ADD_LIBRARY(Physics3D ${polycode3DPhysics_SRCS} ${polycode3DPhysics_HDRS}) +ADD_LIBRARY(Physics3D SHARED ${polycode3DPhysics_SRCS} ${polycode3DPhysics_HDRS}) SET(CMAKE_DEBUG_POSTFIX "_d") +SET_TARGET_PROPERTIES(Physics3D PROPERTIES PREFIX "") + +TARGET_LINK_LIBRARIES(Physics3D + Polycore + ${LUA_LIBRARY} + ${BULLET_LIBRARIES} + "-framework Cocoa" + "-framework IOKit" + ${OPENGL_LIBRARIES} + ${OPENAL_LIBRARY} + ${PNG_LIBRARIES} + ${FREETYPE_LIBRARIES} + ${PHYSFS_LIBRARY} + ${OGG_LIBRARIES} + ${VORBIS_LIBRARIES} + ${VORBISFILE_LIBRARIES} + ${EXTRA_LIBS}) + IF(POLYCODE_INSTALL_FRAMEWORK) # install headers diff --git a/Player/Contents/CMakeLists.txt b/Player/Contents/CMakeLists.txt index 4057d2ad2..621e4cf4c 100644 --- a/Player/Contents/CMakeLists.txt +++ b/Player/Contents/CMakeLists.txt @@ -3,6 +3,7 @@ INCLUDE(PolycodeIncludes) INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} ${Polycode_SOURCE_DIR}/Bindings/Contents/LUA/Include + Include ) SET(CMAKE_DEBUG_POSTFIX "_d") @@ -49,20 +50,31 @@ IF(MSVC) ELSEIF(APPLE) SET(polycodeplayer_SRCS -# Source/PolycodePlayer.cpp - Source/PolycodePlayer.mm + Source/PolycodePlayer.cpp Source/PolycodeCocoaPlayer.mm - "../Build/Mac OS X/main.m" - "../Build/Mac OS X/MyDocument.m" - "../Build/Mac OS X/PPlayerDocumentController.m" + Platform/Darwin/main.m + Platform/Darwin/MyDocument.mm + Platform/Darwin/PPlayerDocumentController.mm ) SET(polycodeplayer_HDRS Include/PolycodePlayer.h Include/PolycodeCocoaPlayer.h - "../Build/Mac OS X/MyDocument.h" - "../Build/Mac OS X/PPlayerDocumentController.h" + Platform/Darwin/MyDocument.h + Platform/Darwin/PPlayerDocumentController.h ) - + + SET(polycodeplayerstandalone_SRCS + Source/PolycodePlayer.cpp + Source/PolycodeCocoaPlayer.mm + Platform/Darwin/Standalone/main.m + Platform/Darwin/Standalone/StandalonePlayerAppDelegate.mm + ) + SET(polycodeplayerstandalone_HDRS + Include/PolycodePlayer.h + Include/PolycodeCocoaPlayer.h + Platform/Darwin/Standalone/StandalonePlayerAppDelegate.h + ) + INCLUDE_DIRECTORIES(Include) # IF(POLYCODE_BUILD_SHARED) @@ -70,12 +82,49 @@ ELSEIF(APPLE) # TARGET_LINK_LIBRARIES(PolycodePlayer Polycore PolycodeLua ${LUA_LIBRARY}) # ENDIF(POLYCODE_BUILD_SHARED) -# IF(POLYCODE_BUILD_STATIC) +find_program(IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin") +if (${IBTOOL} STREQUAL "IBTOOL-NOTFOUND") + message(SEND_ERROR "ibtool can not be found and is needed to compile the .xib files. It should have been installed with + the Apple developer tools. The default system paths were searched in addition to ${OSX_DEVELOPER_ROOT}/usr/bin") +endif() + + + set (PolycodePlayer_XIBS + MainMenu + MyDocument + ) + + set (PolycodePlayerStandalone_XIBS + MainMenu + ) + ADD_EXECUTABLE(PolycodePlayer MACOSX_BUNDLE ${polycodeplayer_SRCS} ${polycodeplayer_HDRS}) + set_target_properties( PolycodePlayer PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/Info.plist ) + + ADD_EXECUTABLE(StandalonePlayer MACOSX_BUNDLE ${polycodeplayerstandalone_SRCS} ${polycodeplayerstandalone_HDRS}) + set_target_properties( StandalonePlayer PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/Standalone/Info.plist ) + TARGET_LINK_LIBRARIES(PolycodePlayer Polycore PolycodeLua "-framework Cocoa" + "-framework IOKit" + ${LUA_LIBRARY} + ${OPENGL_LIBRARIES} + ${OPENAL_LIBRARY} + ${PNG_LIBRARIES} + ${FREETYPE_LIBRARIES} + ${PHYSFS_LIBRARY} + ${OGG_LIBRARY} + ${VORBIS_LIBRARY} + ${VORBISFILE_LIBRARY} + ) + + TARGET_LINK_LIBRARIES(StandalonePlayer + Polycore + PolycodeLua + "-framework Cocoa" + "-framework IOKit" ${LUA_LIBRARY} ${OPENGL_LIBRARIES} ${OPENAL_LIBRARY} @@ -86,7 +135,48 @@ ELSEIF(APPLE) ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ) -# ENDIF(POLYCODE_BUILD_STATIC) + + add_custom_command (TARGET PolycodePlayer PRE_BUILD + COMMAND mkdir -p ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/PolycodePlayer.app/Contents/Resources) + add_custom_command (TARGET PolycodePlayer PRE_BUILD + COMMAND cp ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/app_file_icon.icns ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/PolycodePlayer.app/Contents/Resources) + add_custom_command (TARGET PolycodePlayer PRE_BUILD + COMMAND cp ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/player_icon.icns ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/PolycodePlayer.app/Contents/Resources) + add_custom_command (TARGET PolycodePlayer PRE_BUILD + COMMAND cp ${Polycode_SOURCE_DIR}/Assets/Default\ asset\ pack/default.pak ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/PolycodePlayer.app/Contents/Resources) + add_custom_command (TARGET PolycodePlayer PRE_BUILD + COMMAND cp -R ${Polycode_SOURCE_DIR}/Bindings/Contents/LUA/API ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/PolycodePlayer.app/Contents/Resources) + + add_custom_command (TARGET StandalonePlayer PRE_BUILD + COMMAND mkdir -p ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/StandalonePlayer.app/Contents/Resources) + add_custom_command (TARGET StandalonePlayer PRE_BUILD + COMMAND cp ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/player_icon.icns ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/StandalonePlayer.app/Contents/Resources) + add_custom_command (TARGET StandalonePlayer PRE_BUILD + COMMAND cp ${Polycode_SOURCE_DIR}/Assets/Default\ asset\ pack/default.pak ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/StandalonePlayer.app/Contents/Resources) + add_custom_command (TARGET StandalonePlayer PRE_BUILD + COMMAND cp -R ${Polycode_SOURCE_DIR}/Bindings/Contents/LUA/API ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/StandalonePlayer.app/Contents/Resources) + add_custom_command (TARGET StandalonePlayer PRE_BUILD + COMMAND cp ${Polycode_SOURCE_DIR}/Assets/SamplePolyapp/main.polyapp ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/StandalonePlayer.app/Contents/Resources) + + +foreach(xib ${PolycodePlayer_XIBS}) + add_custom_command (TARGET PolycodePlayer POST_BUILD + COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text + --compile ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/PolycodePlayer.app/Contents/Resources/${xib}.nib + ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/${xib}.xib + COMMENT "Compiling ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/${xib}.xib") + +endforeach() + + +foreach(xib ${PolycodePlayerStandalone_XIBS}) + add_custom_command (TARGET StandalonePlayer POST_BUILD + COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text + --compile ${PROJECT_BINARY_DIR}/Player/Contents/\${CONFIGURATION}/StandalonePlayer.app/Contents/Resources/${xib}.nib + ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/Standalone/${xib}.xib + COMMENT "Compiling ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/Standalone/${xib}.xib") + +endforeach() ENDIF(MSVC) @@ -99,5 +189,9 @@ IF(POLYCODE_INSTALL_PLAYER) # IF(POLYCODE_BUILD_STATIC) INSTALL(TARGETS PolycodePlayer DESTINATION Player) + + INSTALL(TARGETS StandalonePlayer + DESTINATION Player) + # ENDIF() ENDIF(POLYCODE_INSTALL_PLAYER) diff --git a/Player/Contents/Include/PolycodePlayer.h b/Player/Contents/Include/PolycodePlayer.h index 8c4d94d12..2844f30ec 100755 --- a/Player/Contents/Include/PolycodePlayer.h +++ b/Player/Contents/Include/PolycodePlayer.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "Polycode.h" #include "PolycodeLUA.h" #include "PolyGLSLShaderModule.h" +#include "OSBasics.h" extern "C" { #include diff --git a/Player/Contents/Platform/Darwin/Credits.rtf b/Player/Contents/Platform/Darwin/Credits.rtf new file mode 100644 index 000000000..46576ef21 --- /dev/null +++ b/Player/Contents/Platform/Darwin/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/Player/Contents/Platform/Darwin/Info.plist b/Player/Contents/Platform/Darwin/Info.plist new file mode 100644 index 000000000..76e1ec2cf --- /dev/null +++ b/Player/Contents/Platform/Darwin/Info.plist @@ -0,0 +1,63 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + NSDocumentClass + MyDocument + CFBundleTypeRole + Viewer + CFBundleTypeName + Polycode Launcher File + CFBundleTypeExtensions + + polyrun + + + + CFBundleTypeExtensions + + polyapp + + CFBundleTypeIconFile + app_file_icon + CFBundleTypeName + Polycode Application Bundle + CFBundleTypeOSTypes + + ???? + + CFBundleTypeRole + Viewer + NSDocumentClass + MyDocument + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + player_icon + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Player/Contents/Platform/Darwin/InfoPlist.strings b/Player/Contents/Platform/Darwin/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Player/Contents/Platform/Darwin/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Player/Contents/Platform/Darwin/MainMenu.xib b/Player/Contents/Platform/Darwin/MainMenu.xib new file mode 100644 index 000000000..9d7539c53 --- /dev/null +++ b/Player/Contents/Platform/Darwin/MainMenu.xib @@ -0,0 +1,1148 @@ + + + + 1060 + 10J3331a + 1306 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1306 + + + YES + NSMenu + NSMenuItem + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + Polycode Player + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Polycode Player + + YES + + + About Polycode Player + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide Polycode Player + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit Polycode Player + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + + + + View + + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Console + / + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + Polycode Player Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + NSFontManager + + + PPlayerDocumentController + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 371 + + + + openDocument: + + + + 372 + + + + terminate: + + + + 448 + + + + showHelp: + + + + 494 + + + + delegate + + + + 532 + + + + showConsoleWindow: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + 72 + + + + + 82 + + + + + 124 + + + YES + + + + + + 73 + + + + + 79 + + + + + 125 + + + YES + + + + + + 126 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 419 + + + + + 491 + + + YES + + + + + + 492 + + + YES + + + + + + 493 + + + + + 530 + + + + + 534 + + + YES + + + + + + 535 + + + YES + + + + + + 536 + + + + + + + YES + + YES + -3.IBPluginDependency + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 491.IBPluginDependency + 492.IBEditorWindowLastContentRect + 492.IBPluginDependency + 493.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 530.IBPluginDependency + 534.IBPluginDependency + 535.IBPluginDependency + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 81.IBEditorWindowLastContentRect + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 82.IBPluginDependency + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{639, 313}, {194, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{404, 386}, {317, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{11, 977}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + {{855, 363}, {246, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{416, 203}, {241, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{547, 293}, {196, 93}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{155, 774}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + + + + YES + + + + + 537 + + + + YES + + MyDocument + NSDocument + + showConsoleWindow: + id + + + showConsoleWindow: + + showConsoleWindow: + id + + + + YES + + YES + consoleTextView + consoleWindow + mainView + + + YES + NSTextView + NSWindow + PolycodeView + + + + YES + + YES + consoleTextView + consoleWindow + mainView + + + YES + + consoleTextView + NSTextView + + + consoleWindow + NSWindow + + + mainView + PolycodeView + + + + + IBProjectSource + ./Classes/MyDocument.h + + + + NSDocument + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + + IBProjectSource + ./Classes/NSDocument.h + + + + PPlayerDocumentController + NSDocumentController + + IBProjectSource + ./Classes/PPlayerDocumentController.h + + + + PolycodeView + NSOpenGLView + + IBProjectSource + ./Classes/PolycodeView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/Player/Contents/Platform/Darwin/MyDocument.h b/Player/Contents/Platform/Darwin/MyDocument.h new file mode 100644 index 000000000..aec498003 --- /dev/null +++ b/Player/Contents/Platform/Darwin/MyDocument.h @@ -0,0 +1,74 @@ +/* +Copyright (C) 2011 by Ivan Safrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#import +#import "PolycodeView.h" +#include "PolycodeCocoaPlayer.h" + +class PolycodeProxy : public EventHandler { +public: + PolycodeProxy(){ playerDocument = nil; } + ~PolycodeProxy(){} + + void handleEvent(Event *event) { + if(!playerDocument) + return; + + PolycodeDebugEvent *debugEvent = (PolycodeDebugEvent*)event; + switch(event->getEventCode()) { + case PolycodeDebugEvent::EVENT_ERROR: + [playerDocument handleDebugError: [NSString stringWithCString:debugEvent->errorString.c_str()] onLine: debugEvent->lineNumber]; + break; + case PolycodeDebugEvent::EVENT_PRINT: + [playerDocument printToConsole: [NSString stringWithCString:debugEvent->errorString.c_str()]]; + break; + case PolycodeDebugEvent::EVENT_RESIZE: +// printf("RERERERERESIZE\n"); +// [playerDocument resizeDocument: debugEvent->xRes withYRes: debugEvent->yRes]; + break; + } + } + + id playerDocument; +}; + +@interface MyDocument : NSDocument +{ + PolycodeView *mainView; + NSString *docFileName; + NSTimer* timer; + CocoaPolycodePlayer *player; + PolycodeProxy *playerProxy; + NSWindow *consoleWindow; + NSTextView *consoleTextView; + bool showingConsole; +} + +- (void) printToConsole: (NSString*) message; +- (void) handleDebugError: (NSString*) error onLine:(int) lineNumber; +- (IBAction) showConsoleWindow: (id) sender; + +@property (assign) IBOutlet PolycodeView *mainView; +@property (assign) IBOutlet NSWindow *consoleWindow; +@property (assign) IBOutlet NSTextView *consoleTextView; + +@end diff --git a/Player/Contents/Platform/Darwin/MyDocument.mm b/Player/Contents/Platform/Darwin/MyDocument.mm new file mode 100644 index 000000000..60d50432a --- /dev/null +++ b/Player/Contents/Platform/Darwin/MyDocument.mm @@ -0,0 +1,155 @@ +/* +Copyright (C) 2011 by Ivan Safrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#import "MyDocument.h" + +@implementation MyDocument + +@synthesize mainView; +@synthesize consoleWindow; +@synthesize consoleTextView; + +- (id)init +{ + self = [super init]; + if (self) { + showingConsole = NO; + } + return self; +} + +- (NSString *)windowNibName +{ + return @"MyDocument"; +} + +- (void)windowControllerDidLoadNib:(NSWindowController *) aController +{ + [super windowControllerDidLoadNib:aController]; + + player = new CocoaPolycodePlayer(mainView, [docFileName cStringUsingEncoding:NSASCIIStringEncoding], false); + playerProxy = new PolycodeProxy(); + playerProxy->playerDocument = self; + player->addEventListener(playerProxy, PolycodeDebugEvent::EVENT_RESIZE); + player->addEventListener(playerProxy, PolycodeDebugEvent::EVENT_PRINT); + player->addEventListener(playerProxy, PolycodeDebugEvent::EVENT_ERROR); + player->windowData = self; + + player->runPlayer(); + + timer = [NSTimer timerWithTimeInterval:(1.0f/90.0f) target:self selector:@selector(animationTimer:) userInfo:nil repeats:YES]; + [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode]; + [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode]; // ensure timer fires during resize +} + +- (IBAction) showConsoleWindow: (id) sender +{ + if(!showingConsole) { + [consoleWindow makeKeyAndOrderFront:nil]; + } else{ + [consoleWindow close]; + } + showingConsole = !showingConsole; +} + +- (void) handleDebugError: (NSString*) error onLine:(int) lineNumber +{ + +NSTextStorage *textStorage = [consoleTextView textStorage]; + + [consoleTextView setInsertionPointColor: [NSColor whiteColor]]; +[textStorage beginEditing]; + +NSMutableString *fullText = [[NSMutableString alloc] initWithString:@"Error:\""]; +[fullText appendString:error]; +[fullText appendFormat:@"\" on line %d.", lineNumber]; +NSMutableAttributedString *str = [[NSMutableAttributedString alloc ]initWithString: fullText]; +[fullText release]; + +[str addAttribute:NSForegroundColorAttributeName value:[NSColor redColor] range:NSMakeRange(0,[str length])]; +[str addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Menlo" size: 10] range:NSMakeRange(0,[str length])]; + +[textStorage appendAttributedString:str]; +[textStorage endEditing]; +[str release]; + +showingConsole = NO; +[self showConsoleWindow:self]; + +} + +- (void) printToConsole: (NSString*) message +{ + +NSTextStorage *textStorage = [consoleTextView textStorage]; + + [consoleTextView setInsertionPointColor: [NSColor whiteColor]]; +[textStorage beginEditing]; +NSMutableAttributedString *str = [[NSMutableAttributedString alloc ]initWithString: message]; +[str addAttribute:NSForegroundColorAttributeName value:[NSColor whiteColor] range:NSMakeRange(0,[str length])]; +[str addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Menlo" size: 10] range:NSMakeRange(0,[str length])]; + +[textStorage appendAttributedString:str]; +[textStorage endEditing]; +[str release]; +} + +- (void)animationTimer:(NSTimer *)timer +{ + + if(!player->Update()) { + [self close]; + } +} + +- (void)close +{ + [timer invalidate]; + [timer release]; + delete player; + delete playerProxy; + [super close]; +} + +- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError +{ + // Insert code here to write your document to data of the specified type. If the given outError != NULL, ensure that you set *outError when returning nil. + + // You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead. + + // For applications targeted for Panther or earlier systems, you should use the deprecated API -dataRepresentationOfType:. In this case you can also choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: instead. + + if ( outError != NULL ) { + *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; + } + return nil; +} + +- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError +{ + NSLog(@"Reading from %@\n", docFileName); + docFileName = [[NSString stringWithString:[absoluteURL path]] retain]; + + return YES; +} + +@end diff --git a/Player/Contents/Platform/Darwin/MyDocument.xib b/Player/Contents/Platform/Darwin/MyDocument.xib new file mode 100644 index 000000000..e4a957b4f --- /dev/null +++ b/Player/Contents/Platform/Darwin/MyDocument.xib @@ -0,0 +1,622 @@ + + + + 1060 + 10J3331a + 1306 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1306 + + + YES + NSView + NSCustomObject + NSScrollView + NSWindowTemplate + NSTextView + NSScroller + NSOpenGLView + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + MyDocument + + + FirstResponder + + + 7 + 2 + {{133, 235}, {507, 413}} + 1350041600 + Window + NSWindow + View + {94, 86} + + + 256 + + YES + + + 1298 + + {507, 413} + + + + + + AAAAYAAAAAA + + + + + {{7, 11}, {507, 413}} + + + + + {{0, 0}, {1680, 1028}} + {94, 108} + {1e+13, 1e+13} + + + NSApplication + + + 8223 + 2 + {{685, 247}, {480, 270}} + 1685585920 + Console + NSPanel + + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 2322 + {440, 14} + + + + + + + + + + + + YES + + + 134 + + + + 440 + 1 + + + 12261 + 0 + + + 1 + MCAwIDAgMAA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + 1 + MSAxIDEAA + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {482, 1e+07} + {223, 8} + + + + {440, 230} + + + + + + 3 + MQA + + + {4, -5} + 1 + + 2 + + + + -2147483392 + {{-100, -100}, {15, 249}} + + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{20, 20}, {440, 230}} + + + + 528 + + + + + + {{7, 11}, {480, 270}} + + + + {{0, 0}, {1680, 1028}} + {1e+13, 1e+13} + + + + + YES + + + delegate + + + + 17 + + + + substanceView + + + + 100022 + + + + window + + + + 100023 + + + + mainView + + + + 100024 + + + + consoleWindow + + + + 100027 + + + + consoleTextView + + + + 100032 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 5 + + + YES + + + + Window + + + 6 + + + YES + + + + + + -3 + + + Application + + + 100021 + + + + + 100025 + + + YES + + + + + + 100026 + + + YES + + + + + + 100028 + + + YES + + + + + + + + 100029 + + + + + 100030 + + + + + 100031 + + + + + + + YES + + YES + -3.IBPluginDependency + 100021.CustomClassName + 100021.IBPluginDependency + 100021.IBViewBoundsToFrameTransform + 100025.IBPluginDependency + 100025.NSWindowTemplate.visibleAtLaunch + 100026.IBPluginDependency + 100028.IBPluginDependency + 100029.IBPluginDependency + 100030.IBPluginDependency + 100031.IBPluginDependency + 5.IBEditorWindowLastContentRect + 5.IBPluginDependency + 5.IBViewEditorWindowController.showingLayoutRectangles + 5.IBWindowTemplateEditedContentRect + 5.ImportedFromIB2 + 5.NSWindowTemplate.visibleAtLaunch + 5.editorWindowContentRectSynchronizationRect + 6.IBPluginDependency + 6.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + PolycodeView + com.apple.InterfaceBuilder.CocoaPlugin + + AUEQAABDEAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{553, 417}, {507, 413}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{553, 417}, {507, 413}} + + + {{201, 387}, {507, 413}} + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + + + + YES + + + + + 100032 + + + + YES + + MyDocument + NSDocument + + showConsoleWindow: + id + + + showConsoleWindow: + + showConsoleWindow: + id + + + + YES + + YES + consoleTextView + consoleWindow + mainView + + + YES + NSTextView + NSWindow + PolycodeView + + + + YES + + YES + consoleTextView + consoleWindow + mainView + + + YES + + consoleTextView + NSTextView + + + consoleWindow + NSWindow + + + mainView + PolycodeView + + + + + IBProjectSource + ./Classes/MyDocument.h + + + + NSDocument + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + + IBProjectSource + ./Classes/NSDocument.h + + + + PolycodeView + NSOpenGLView + + IBProjectSource + ./Classes/PolycodeView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/Player/Contents/Platform/Darwin/PPlayerDocumentController.h b/Player/Contents/Platform/Darwin/PPlayerDocumentController.h new file mode 100644 index 000000000..a86f011f2 --- /dev/null +++ b/Player/Contents/Platform/Darwin/PPlayerDocumentController.h @@ -0,0 +1,30 @@ +/* +Copyright (C) 2011 by Ivan Safrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#import + + +@interface PPlayerDocumentController : NSDocumentController { + +} + +@end diff --git a/Player/Contents/Platform/Darwin/PPlayerDocumentController.mm b/Player/Contents/Platform/Darwin/PPlayerDocumentController.mm new file mode 100644 index 000000000..30ce8c4f4 --- /dev/null +++ b/Player/Contents/Platform/Darwin/PPlayerDocumentController.mm @@ -0,0 +1,35 @@ +/* +Copyright (C) 2011 by Ivan Safrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#import "PPlayerDocumentController.h" + + +@implementation PPlayerDocumentController + + +- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender +{ + return NO; +} + + +@end diff --git a/Player/Contents/Platform/Darwin/Standalone/Info.plist b/Player/Contents/Platform/Darwin/Standalone/Info.plist new file mode 100644 index 000000000..b9508968b --- /dev/null +++ b/Player/Contents/Platform/Darwin/Standalone/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + player_icon.icns + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Player/Contents/Platform/Darwin/Standalone/InfoPlist.strings b/Player/Contents/Platform/Darwin/Standalone/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Player/Contents/Platform/Darwin/Standalone/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Player/Contents/Platform/Darwin/Standalone/MainMenu.xib b/Player/Contents/Platform/Darwin/Standalone/MainMenu.xib new file mode 100644 index 000000000..36ce254cd --- /dev/null +++ b/Player/Contents/Platform/Darwin/Standalone/MainMenu.xib @@ -0,0 +1,573 @@ + + + + 1060 + 10J3331a + 1306 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1306 + + + YES + NSMenuItem + NSWindowTemplate + NSView + NSMenu + NSCustomObject + NSOpenGLView + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + Polycode + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Polycode + + YES + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide StandalonePlayer + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit StandalonePlayer + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + _NSMainMenu + + + 15 + 2 + {{335, 390}, {480, 360}} + 1954021376 + + NSWindow + + + + 256 + + YES + + + 1298 + + {480, 360} + + + + + AAAAYAAAAAA + + + + + {{7, 11}, {480, 360}} + + + + {{0, 0}, {1680, 1028}} + {1e+13, 1e+13} + + + StandalonePlayerAppDelegate + + + NSFontManager + + + + + YES + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + terminate: + + + + 449 + + + + delegate + + + + 495 + + + + window + + + + 532 + + + + mainView + + + + 534 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + 371 + + + YES + + + + + + 372 + + + YES + + + + + + 420 + + + + + 494 + + + + + 533 + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + 145 + + + + + 149 + + + + + 131 + + + YES + + + + + + 130 + + + + + 144 + + + + + 136 + + + + + 150 + + + + + 134 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 371.IBEditorWindowLastContentRect + 371.IBPluginDependency + 371.IBWindowTemplateEditedContentRect + 371.NSWindowTemplate.visibleAtLaunch + 371.editorWindowContentRectSynchronizationRect + 372.IBPluginDependency + 420.IBPluginDependency + 494.IBPluginDependency + 533.CustomClassName + 533.IBPluginDependency + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{380, 836}, {512, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + {{380, 496}, {480, 360}} + com.apple.InterfaceBuilder.CocoaPlugin + {{380, 496}, {480, 360}} + + {{33, 99}, {480, 360}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + PolycodeView + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{286, 129}, {275, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + + + + YES + + + + + + YES + + + + + 534 + + + + YES + + PolycodeView + NSOpenGLView + + IBProjectSource + ./Classes/PolycodeView.h + + + + StandalonePlayerAppDelegate + NSObject + + YES + + YES + mainView + window + + + YES + PolycodeView + NSWindow + + + + YES + + YES + mainView + window + + + YES + + mainView + PolycodeView + + + window + NSWindow + + + + + IBProjectSource + ./Classes/StandalonePlayerAppDelegate.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/Player/Contents/Platform/Darwin/Standalone/StandalonePlayerAppDelegate.h b/Player/Contents/Platform/Darwin/Standalone/StandalonePlayerAppDelegate.h new file mode 100644 index 000000000..b21e82197 --- /dev/null +++ b/Player/Contents/Platform/Darwin/Standalone/StandalonePlayerAppDelegate.h @@ -0,0 +1,24 @@ +// +// StandalonePlayerAppDelegate.h +// StandalonePlayer +// +// Created by Ivan Safrin on 5/25/11. +// Copyright 2011 Tomatogon. All rights reserved. +// + +#import +#import "PolycodeView.h" +#include "PolycodeCocoaPlayer.h" + +@interface StandalonePlayerAppDelegate : NSObject { +@private + NSWindow *window; + PolycodeView *mainView; + CocoaPolycodePlayer *player; + NSTimer *timer; +} + +@property (assign) IBOutlet NSWindow *window; +@property (assign) IBOutlet PolycodeView *mainView; + +@end diff --git a/Player/Contents/Platform/Darwin/Standalone/StandalonePlayerAppDelegate.mm b/Player/Contents/Platform/Darwin/Standalone/StandalonePlayerAppDelegate.mm new file mode 100644 index 000000000..1e4f10a98 --- /dev/null +++ b/Player/Contents/Platform/Darwin/Standalone/StandalonePlayerAppDelegate.mm @@ -0,0 +1,38 @@ +// +// StandalonePlayerAppDelegate.m +// StandalonePlayer +// +// Created by Ivan Safrin on 5/25/11. +// Copyright 2011 Tomatogon. All rights reserved. +// + +#import "StandalonePlayerAppDelegate.h" + +@implementation StandalonePlayerAppDelegate + +@synthesize window; +@synthesize mainView; + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + chdir([[[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/Resources"] UTF8String]); + + player = new CocoaPolycodePlayer(mainView, "main.polyapp", false); + player->windowData = self; + player->runPlayer(); + + timer = [NSTimer timerWithTimeInterval:(1.0f/90.0f) target:self selector:@selector(animationTimer:) userInfo:nil repeats:YES]; + [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode]; + [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode]; // ensure timer fires during resize + +} + +- (void)animationTimer:(NSTimer *)timer +{ + + if(!player->Update()) { + [self close]; + } +} + +@end diff --git a/Player/Contents/Platform/Darwin/Standalone/main.m b/Player/Contents/Platform/Darwin/Standalone/main.m new file mode 100644 index 000000000..9a785ba64 --- /dev/null +++ b/Player/Contents/Platform/Darwin/Standalone/main.m @@ -0,0 +1,14 @@ +// +// main.m +// StandalonePlayer +// +// Created by Ivan Safrin on 5/25/11. +// Copyright 2011 Tomatogon. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/Player/Contents/Platform/Darwin/app_file_icon.icns b/Player/Contents/Platform/Darwin/app_file_icon.icns new file mode 100644 index 000000000..1943f9933 Binary files /dev/null and b/Player/Contents/Platform/Darwin/app_file_icon.icns differ diff --git a/Player/Contents/Platform/Darwin/main.m b/Player/Contents/Platform/Darwin/main.m new file mode 100644 index 000000000..2a773a17c --- /dev/null +++ b/Player/Contents/Platform/Darwin/main.m @@ -0,0 +1,28 @@ +/* +Copyright (C) 2011 by Ivan Safrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +} diff --git a/Player/Contents/Platform/Darwin/player_icon.icns b/Player/Contents/Platform/Darwin/player_icon.icns new file mode 100644 index 000000000..18401bd36 Binary files /dev/null and b/Player/Contents/Platform/Darwin/player_icon.icns differ diff --git a/Player/Contents/Source/PolycodeCocoaPlayer.mm b/Player/Contents/Source/PolycodeCocoaPlayer.mm index 120b11052..0a59021f9 100644 --- a/Player/Contents/Source/PolycodeCocoaPlayer.mm +++ b/Player/Contents/Source/PolycodeCocoaPlayer.mm @@ -31,5 +31,5 @@ of this software and associated documentation files (the "Software"), to deal } void CocoaPolycodePlayer::createCore() { - core = new CocoaCore(view, xRes, yRes, fullScreen, aaLevel, frameRate); + core = new CocoaCore(view, xRes, yRes, fullScreen, false, 0, aaLevel, frameRate); } \ No newline at end of file diff --git a/Player/Contents/Source/PolycodePlayer.cpp b/Player/Contents/Source/PolycodePlayer.cpp index fc81ab572..5dccb494a 100644 --- a/Player/Contents/Source/PolycodePlayer.cpp +++ b/Player/Contents/Source/PolycodePlayer.cpp @@ -21,6 +21,7 @@ THE SOFTWARE. */ #include "PolycodePlayer.h" +#include extern "C" { // extern int luaopen_Tau(lua_State* L); // declare the wrapped module @@ -31,7 +32,7 @@ extern "C" { std::string module = lua_tostring(pState, 1); module += ".lua"; - string defaultPath = "API/"; + std::string defaultPath = "API/"; defaultPath.append(module); const char* fullPath = module.c_str(); @@ -66,9 +67,9 @@ extern "C" { const char *msg = lua_tostring(L, 1); PolycodeDebugEvent *event = new PolycodeDebugEvent(); if(msg) - event->errorString = string(msg); + event->errorString = std::string(msg); else - event->errorString = string(""); + event->errorString = std::string(""); Logger::log(">> %s\n", event->errorString.c_str()); PolycodePlayer *player = (PolycodePlayer*)CoreServices::getInstance()->getCore()->getUserPointer(); @@ -86,14 +87,14 @@ extern "C" { Logger::log("status=%d, %s\n", status, msg); lua_pop(L, 1); - vector info = String(msg).split(":"); + std::vector info = String(msg).split(":"); PolycodeDebugEvent *event = new PolycodeDebugEvent(); if(info.size() > 2) { event->errorString = info[2]; event->lineNumber = atoi(info[1].c_str()); } else { - event->errorString = string(msg); + event->errorString = std::string(msg); event->lineNumber = 0; } dispatchEvent(event, PolycodeDebugEvent::EVENT_ERROR); @@ -314,7 +315,7 @@ void PolycodePlayer::loadFile(const char *fileName) { ResourceManager *rman = CoreServices::getInstance()->getResourceManager(); String fileDir = ""; - vector bits = String(fileName).split("/"); + std::vector bits = String(fileName).split("/"); for(int i=0; i < bits.size()-1; i++) { fileDir += "/"+bits[i]; } @@ -439,7 +440,7 @@ void PolycodePlayer::loadFile(const char *fileName) { core->setUserPointer(this); //core->addEventListener(this, Core::EVENT_CORE_RESIZE); - core->setVideoMode(xRes, yRes, fullScreen, aaLevel); + core->setVideoMode(xRes, yRes, fullScreen, false, 0, aaLevel); CoreServices::getInstance()->getResourceManager()->addArchive("default.pak"); CoreServices::getInstance()->getResourceManager()->addDirResource("default", false); diff --git a/Standalone/CMakeLists.txt b/Standalone/CMakeLists.txt new file mode 100644 index 000000000..c876d67aa --- /dev/null +++ b/Standalone/CMakeLists.txt @@ -0,0 +1,23 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +PROJECT(PolycodeStandalone) + +SET(POLYCODE_RELEASE_DIR ${PolycodeStandalone_SOURCE_DIR}/../Release/${CMAKE_SYSTEM_NAME}) +SET(CMAKE_INSTALL_PREFIX ${POLYCODE_RELEASE_DIR}/Standalone/) + +INSTALL(FILES ../LICENSE.txt + DESTINATION ./) + +INSTALL(DIRECTORY ${POLYCODE_RELEASE_DIR}/Framework/Player/PolycodePlayer.app DESTINATION Player USE_SOURCE_PERMISSIONS) +INSTALL(DIRECTORY ${POLYCODE_RELEASE_DIR}/Framework/Player/StandalonePlayer.app DESTINATION Publish/Mac USE_SOURCE_PERMISSIONS) +INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Tools/polybuild DESTINATION Bin) +INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Tools/polyimport DESTINATION Bin) +INSTALL(DIRECTORY ${PolycodeStandalone_SOURCE_DIR}/../Assets/Templates/Lua DESTINATION Template) + +#modules +INSTALL(DIRECTORY ${PolycodeStandalone_SOURCE_DIR}/../Modules/Bindings/2DPhysics/API DESTINATION Modules/Physics2D) +INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Bindings/Lua/Modules/2DPhysics/lib/Physics2D.dylib DESTINATION Modules/Physics2D/Lib/osx) + +INSTALL(DIRECTORY ${PolycodeStandalone_SOURCE_DIR}/../Modules/Bindings/3DPhysics/API DESTINATION Modules/Physics3D) +INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Bindings/Lua/Modules/3DPhysics/lib/Physics3D.dylib DESTINATION Modules/Physics3D/Lib/osx) +