修訂 | d8713c914cfccd6179098b2418fcf7f802398302 (tree) |
---|---|
時間 | 2021-05-11 04:13:51 |
作者 | sebastian_bugiu |
Commiter | sebastian_bugiu |
Fixed bug where ship hit animation would change the skybox as the value always defaulted to skybox 0.
@@ -2241,6 +2241,7 @@ | ||
2241 | 2241 | long long int compositorWorkspacePtr = bufferReadLong.read(&buf); |
2242 | 2242 | Ogre::CompositorWorkspace* compositorWorkspace = (Ogre::CompositorWorkspace*) compositorWorkspacePtr; |
2243 | 2243 | unsigned char enabled = bufferReadChar.read(&buf); |
2244 | + // LOGI("compositor ptr: %s, enabled: %s \n", SSTR(compositorWorkspacePtr).c_str(), SSTR(enabled ? 1 : 0).c_str()); | |
2244 | 2245 | compositorWorkspace->setEnabled((bool) enabled); |
2245 | 2246 | } |
2246 | 2247 | break; |
@@ -1369,15 +1369,19 @@ | ||
1369 | 1369 | } |
1370 | 1370 | |
1371 | 1371 | public void exitGame() { |
1372 | - exitLock.lock(); | |
1373 | - try { | |
1374 | - MainApp.getGame().setExiting(); | |
1375 | - // Get rid of everything in the level and show the main menu | |
1376 | - // for next time when we come in | |
1377 | - Gdx.app.exit(); | |
1372 | + if (MainApp.PLATFORM == MainApp.Platform.DESKTOP) { | |
1373 | + exitLock.lock(); | |
1374 | + try { | |
1375 | + MainApp.getGame().setExiting(); | |
1376 | + // Get rid of everything in the level and show the main menu | |
1377 | + // for next time when we come in | |
1378 | + Gdx.app.exit(); | |
1378 | 1379 | // MainActivity.getInstance().finish(); |
1379 | - } finally { | |
1380 | - exitLock.unlock(); | |
1380 | + } finally { | |
1381 | + exitLock.unlock(); | |
1382 | + } | |
1383 | + } else { | |
1384 | + throw new IllegalStateException("You are not supposed to close applications on mobile platforms"); | |
1381 | 1385 | } |
1382 | 1386 | } |
1383 | 1387 |
@@ -53,7 +53,7 @@ | ||
53 | 53 | // Utility.lookAt(entityProperties.getNode(), cameraProperties.getNode()); |
54 | 54 | } else { |
55 | 55 | // Continue to look at the projection of the position vector to follow the explosion trails. |
56 | - // To be done in the future version. | |
56 | + // TODO To be done in the future version. | |
57 | 57 | } |
58 | 58 | // camera.lookAt(positionToLookAt); |
59 | 59 |
@@ -62,10 +62,10 @@ | ||
62 | 62 | @Override |
63 | 63 | public void animationFinished() { |
64 | 64 | destroyResources(); |
65 | - CameraProperties cameraProperties = WorldManager.getSingleton().getCameraPropertiesComponentMapper().getSafe(playerShip); | |
66 | - if (cameraProperties != null) { | |
67 | - cameraProperties.setAnimatedCamera(false); | |
68 | - } | |
65 | +// CameraProperties cameraProperties = WorldManager.getSingleton().getCameraPropertiesComponentMapper().getSafe(playerShip); | |
66 | +// if (cameraProperties != null) { | |
67 | +// cameraProperties.setAnimatedCamera(false); | |
68 | +// } | |
69 | 69 | } |
70 | 70 | |
71 | 71 | @Override |
@@ -132,10 +132,12 @@ | ||
132 | 132 | currentWorkspace = new Workspace(CompositorEnum.MENU, DEFAULT_COMP, 0); |
133 | 133 | } |
134 | 134 | |
135 | - public void setInGameCompositor(String name) { | |
135 | + public void setInGameCompositor(String workspaceName) { | |
136 | 136 | disableCurrentCompositor(); |
137 | - ENG_CompositorManager2.getSingleton().setCompositorEnabled(name, true); | |
138 | - currentWorkspace = new Workspace(CompositorEnum.MENU, name, 0); | |
137 | + ENG_CompositorManager2.getSingleton().setCompositorEnabled(workspaceName, true); | |
138 | + String skyboxNumStr = workspaceName.substring(workspaceName.indexOf(SKYBOX_WORKSPACE) + SKYBOX_WORKSPACE.length()); | |
139 | + int skyboxWorkspaceNum = Integer.parseInt(skyboxNumStr); | |
140 | + currentWorkspace = new Workspace(CompositorEnum.MENU, workspaceName, skyboxWorkspaceNum); | |
139 | 141 | } |
140 | 142 | |
141 | 143 | public void setShipHitCompositor(boolean enabled) { |
@@ -127,6 +127,7 @@ | ||
127 | 127 | // necessarily the latest one so if we send this one to check |
128 | 128 | // for visibility we may get a false response since the camera may have |
129 | 129 | // advanced with the player beyond the worldaabb point. |
130 | + // TODO find a nicer solution. | |
130 | 131 | rayTarget.z -= camera.getNearClipDistance() + 15.0f; |
131 | 132 | // System.out.println("rayTarget pos after z update: " + rayTarget); |
132 | 133 | // System.out.println("billboard set worldaabb: " + set.getWorldAABB()); |
@@ -73,7 +73,7 @@ | ||
73 | 73 | CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF |
74 | 74 | |
75 | 75 | //iOS find search path root |
76 | -CMAKE_FIND_ROOT_PATH:STRING=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.3.sdk | |
76 | +CMAKE_FIND_ROOT_PATH:STRING=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk | |
77 | 77 | |
78 | 78 | //Path to a program. |
79 | 79 | CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool |
@@ -124,7 +124,7 @@ | ||
124 | 124 | |
125 | 125 | //The product will be built against the headers and libraries located |
126 | 126 | // inside the indicated SDK. |
127 | -CMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.3.sdk | |
127 | +CMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk | |
128 | 128 | |
129 | 129 | //Value Computed by CMake |
130 | 130 | CMAKE_PROJECT_DESCRIPTION:STATIC= |
@@ -356,7 +356,7 @@ | ||
356 | 356 | //ADVANCED property for variable: CMAKE_STRIP |
357 | 357 | CMAKE_STRIP-ADVANCED:INTERNAL=1 |
358 | 358 | CMAKE_SYSTEM_NAME:INTERNAL=Darwin |
359 | -CMAKE_SYSTEM_VERSION:INTERNAL=14.3 | |
359 | +CMAKE_SYSTEM_VERSION:INTERNAL=14.4 | |
360 | 360 | //uname command |
361 | 361 | CMAKE_UNAME:INTERNAL=/usr/bin/uname |
362 | 362 | //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE |
@@ -2,7 +2,7 @@ | ||
2 | 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.13 |
3 | 3 | |
4 | 4 | # compile CXX with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ |
5 | -CXX_FLAGS = -miphoneos-version-min=9.0 -fvisibility=hidden -fvisibility-inlines-hidden -fobjc-abi-version=2 -fobjc-arc -arch arm64 -g -DDEBUG -std=gnu++11 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.3.sdk | |
5 | +CXX_FLAGS = -miphoneos-version-min=9.0 -fvisibility=hidden -fvisibility-inlines-hidden -fobjc-abi-version=2 -fobjc-arc -arch arm64 -g -DDEBUG -std=gnu++11 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk | |
6 | 6 | |
7 | 7 | CXX_DEFINES = |
8 | 8 |