2
0
Ivan Safrin 14 жил өмнө
parent
commit
3b6ac6db33

+ 2 - 5
Assets/Default asset pack/CMakeLists.txt

@@ -1,8 +1,5 @@
 #TODO: actually build the pak file
 #TODO: actually build the pak file
 IF(POLYCODE_INSTALL_FRAMEWORK)
 IF(POLYCODE_INSTALL_FRAMEWORK)
-    
-    # install default.pak file
-    INSTALL(FILES default.pak
-        DESTINATION Core/Assets)
-    
+    INSTALL(FILES default.pak DESTINATION Core/Assets)
+    INSTALL(FILES hdr.pak DESTINATION Core/Assets)
 ENDIF(POLYCODE_INSTALL_FRAMEWORK)
 ENDIF(POLYCODE_INSTALL_FRAMEWORK)

BIN
Bindings/Contents/LUA/API/api.pak


+ 73 - 0
Player/Contents/CMakeLists.txt

@@ -182,6 +182,66 @@ foreach(xib ${PolycodePlayerStandalone_XIBS})
                       COMMENT "Compiling ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/Standalone/${xib}.xib")
                       COMMENT "Compiling ${Polycode_SOURCE_DIR}/Player/Contents/Platform/Darwin/Standalone/${xib}.xib")
 
 
 endforeach()
 endforeach()
+ELSE(MSVC)
+
+ SET(polycodeplayer_SRCS 
+        Source/PolycodePlayer.cpp
+        Source/PolycodeLinuxPlayer.cpp
+        Platform/Linux/main.cpp
+    )
+
+    SET(polycodeplayer_HDRS 
+        Include/PolycodePlayer.h
+        Include/PolycodeLinuxPlayer.h
+    )
+  
+    SET(polycodeplayerstandalone_SRCS 
+        Source/PolycodePlayer.cpp
+        Source/PolycodeLinuxPlayer.cpp
+        Platform/Linux/Standalone/main.cpp
+    )
+    SET(polycodeplayerstandalone_HDRS 
+        Include/PolycodePlayer.h
+        Include/PolycodeLinuxPlayer.h
+    )
+ 
+    INCLUDE_DIRECTORIES(Include)
+ 
+    ADD_EXECUTABLE(PolycodePlayer ${polycodeplayer_SRCS} ${polycodeplayer_HDRS})
+    ADD_EXECUTABLE(StandalonePlayer ${polycodeplayerstandalone_SRCS} ${polycodeplayerstandalone_HDRS})
+    
+
+    TARGET_LINK_LIBRARIES(PolycodePlayer 
+        PolycodeLua 
+        Polycore 
+        ${LUA_LIBRARY}
+        ${OPENGL_LIBRARIES}
+        ${OPENAL_LIBRARY}
+        ${PNG_LIBRARIES}
+        ${FREETYPE_LIBRARIES}
+        ${PHYSFS_LIBRARY}
+        ${OGG_LIBRARY}
+        ${VORBIS_LIBRARY}
+        ${VORBISFILE_LIBRARY}
+        ${SDL_LIBRARY}
+     )
+
+    TARGET_LINK_LIBRARIES(StandalonePlayer 
+        PolycodeLua 
+        Polycore 
+        ${LUA_LIBRARY}
+        ${OPENGL_LIBRARIES}
+        ${OPENAL_LIBRARY}
+        ${PNG_LIBRARIES}
+        ${FREETYPE_LIBRARIES}
+        ${PHYSFS_LIBRARY}
+        ${OGG_LIBRARY}
+        ${VORBIS_LIBRARY}
+        ${VORBISFILE_LIBRARY}
+        ${SDL_LIBRARY}
+     )
+
+    
 
 
 ENDIF(MSVC)
 ENDIF(MSVC)
 
 
@@ -198,5 +258,18 @@ IF(POLYCODE_INSTALL_PLAYER)
     INSTALL(TARGETS StandalonePlayer 
     INSTALL(TARGETS StandalonePlayer 
         DESTINATION Player)
         DESTINATION Player)
 
 
+IF(MSVC)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Assets/Default\ asset\ pack/default.pak" DESTINATION Player)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Assets/Default\ asset\ pack/hdr.pak" DESTINATION Player)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Assets/SamplePolyapp/main.polyapp" DESTINATION Player)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Bindings/Contents/LUA/API/api.pak" DESTINATION Player)
+ELSEIF(APPLE)
+ELSE(MSVC)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Assets/Default\ asset\ pack/default.pak" DESTINATION Player)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Assets/Default\ asset\ pack/hdr.pak" DESTINATION Player)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Assets/SamplePolyapp/main.polyapp" DESTINATION Player)
+    INSTALL(FILES "${Polycode_SOURCE_DIR}/Bindings/Contents/LUA/API/api.pak" DESTINATION Player)
+ENDIF(MSVC)
+
 #    ENDIF()
 #    ENDIF()
 ENDIF(POLYCODE_INSTALL_PLAYER)
 ENDIF(POLYCODE_INSTALL_PLAYER)

+ 11 - 0
Player/Contents/Platform/Linux/Standalone/main.cpp

@@ -0,0 +1,11 @@
+#include "Polycode.h"
+#include "PolycodeView.h"
+#include "PolycodeLinuxPlayer.h"
+
+int main(int argc, char *argv[]) {
+	PolycodeView *view = new PolycodeView("Polycode Player");
+	PolycodeLinuxPlayer *player = new PolycodeLinuxPlayer(view, "main.polyapp", false);
+	player->runPlayer();
+	while(player->Update()) {}
+	return 0;
+}

+ 15 - 0
Player/Contents/Platform/Linux/main.cpp

@@ -0,0 +1,15 @@
+#include "Polycode.h"
+#include "PolycodeView.h"
+#include "PolycodeLinuxPlayer.h"
+
+int main(int argc, char *argv[]) {
+	PolycodeView *view = new PolycodeView("Polycode Player");
+	if(argc < 2) {
+		printf("Filename required!\n");
+		return 1;
+	}
+	PolycodeLinuxPlayer *player = new PolycodeLinuxPlayer(view, argv[1], false);
+	player->runPlayer();
+	while(player->Update()) {}
+	return 0;
+}

+ 1 - 1
Player/Contents/Source/PolycodeLinuxPlayer.cpp

@@ -31,5 +31,5 @@ PolycodeLinuxPlayer::~PolycodeLinuxPlayer() {
 }
 }
 
 
 void PolycodeLinuxPlayer::createCore() {
 void PolycodeLinuxPlayer::createCore() {
-	core =  new SDLCore(view, xRes, yRes,  fullScreen, aaLevel, frameRate);	
+	core =  new SDLCore(view, xRes, yRes,  fullScreen, false, aaLevel, 0, frameRate);	
 }
 }

+ 23 - 8
Standalone/CMakeLists.txt

@@ -8,16 +8,31 @@ SET(CMAKE_INSTALL_PREFIX ${POLYCODE_RELEASE_DIR}/Standalone/)
 INSTALL(FILES ../LICENSE.txt
 INSTALL(FILES ../LICENSE.txt
         DESTINATION ./)
         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(DIRECTORY ${PolycodeStandalone_SOURCE_DIR}/../Modules/Bindings/2DPhysics/API DESTINATION Modules/Physics2D)
+INSTALL(DIRECTORY ${PolycodeStandalone_SOURCE_DIR}/../Modules/Bindings/3DPhysics/API DESTINATION Modules/Physics3D)
+
+IF(MSVC)
+ELSEIF(APPLE)
+	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(FILES ${POLYCODE_RELEASE_DIR}/Framework/Bindings/Lua/Modules/2DPhysics/lib/Physics2D.dylib DESTINATION Modules/Physics2D/Lib/osx)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Bindings/Lua/Modules/3DPhysics/lib/Physics3D.dylib DESTINATION Modules/Physics3D/Lib/osx)
+ELSE(MSVC)
+	INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Player/PolycodePlayer DESTINATION Player)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/default.pak DESTINATION Player)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/hdr.pak DESTINATION Player)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/api.pak DESTINATION Player)
+	INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Player/StandalonePlayer DESTINATION Publish/Linux)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/default.pak DESTINATION Publish/Linux)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/hdr.pak DESTINATION Publish/Linux)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/api.pak DESTINATION Publish/Linux)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/main.polyapp DESTINATION Publish/Linux)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Bindings/Lua/Modules/2DPhysics/lib/Physics2D.so DESTINATION Modules/Physics2D/Lib/linux)
+	INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Bindings/Lua/Modules/3DPhysics/lib/Physics3D.so DESTINATION Modules/Physics3D/Lib/linux)
+ENDIF(MSVC)
+
 INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Tools/polybuild DESTINATION Bin)
 INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Tools/polybuild DESTINATION Bin)
 INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Tools/polyimport DESTINATION Bin)
 INSTALL(PROGRAMS ${POLYCODE_RELEASE_DIR}/Framework/Tools/polyimport DESTINATION Bin)
 INSTALL(DIRECTORY ${PolycodeStandalone_SOURCE_DIR}/../Assets/Templates/Lua DESTINATION Template)
 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)