Revision | 817fa5e711c9d18c981be17b76b3edc04ed92d33 (tree) |
---|---|
Zeit | 2021-04-26 05:16:36 |
Autor | sebastian_bugiu |
Commiter | sebastian_bugiu |
Removed prints.
@@ -201,7 +201,7 @@ | ||
201 | 201 | if (entityProperties.getHealth() <= 0) { |
202 | 202 | collisionResolved = false; |
203 | 203 | entityDestroyed = true; |
204 | - System.out.println("Entity: " + entityProperties.getName() + " destroyed"); | |
204 | +// System.out.println("Entity: " + entityProperties.getName() + " destroyed"); | |
205 | 205 | } |
206 | 206 | |
207 | 207 | } |
@@ -524,7 +524,7 @@ | ||
524 | 524 | MainApp.getGame().getWorldManager().createCountermeasures(e); |
525 | 525 | shipProperties.setAfterburnerActive(true); |
526 | 526 | shipProperties.setCountermeasuresLastLaunchTime(); |
527 | - System.out.println("Creating countermeasure for entity: " + entityProperties.getName()); | |
527 | +// System.out.println("Creating countermeasure for entity: " + entityProperties.getName()); | |
528 | 528 | } |
529 | 529 | } |
530 | 530 | EntityProperties projectileEntityProperties = entityPropertiesMapper.get(minDistProjectile); |
@@ -1,5 +1,7 @@ | ||
1 | 1 | package headwayent.hotshotengine; |
2 | 2 | |
3 | +import com.badlogic.gdx.Gdx; | |
4 | + | |
3 | 5 | import headwayent.blackholedarksun.APP_Game; |
4 | 6 | import headwayent.blackholedarksun.MainActivity; |
5 | 7 | import headwayent.blackholedarksun.automationframework.AutomationFramework; |
@@ -327,7 +329,24 @@ | ||
327 | 329 | // long beginFrame = System.currentTimeMillis(); |
328 | 330 | // long endFrame = 0; |
329 | 331 | // int frameNum = 0; |
332 | + long lastGCTime = 0; | |
333 | + long averageCycleTime = ENG_Utility.currentTimeMillis(); | |
334 | + final int averageStepNum = 100; | |
335 | + int currentStep = 0; | |
330 | 336 | while (true) { |
337 | + if ((++currentStep) == averageStepNum) { | |
338 | + currentStep = 0; | |
339 | + long currentTime = ENG_Utility.currentTimeMillis(); | |
340 | + System.out.println("average FPS: " + ((currentTime - averageCycleTime) / (float) averageStepNum)); | |
341 | + averageCycleTime = currentTime; | |
342 | + } | |
343 | +// if (ENG_Utility.hasTimePassed(lastGCTime, 5000)) { | |
344 | +// lastGCTime = ENG_Utility.currentTimeMillis(); | |
345 | +//// System.gc(); | |
346 | +// System.out.println("System.gc() duration: " + | |
347 | +// (ENG_Utility.currentTimeMillis() - lastGCTime) + " java heap: " + Gdx.app.getJavaHeap() + " native heap: " + Gdx.app.getNativeHeap()); | |
348 | +// } | |
349 | + | |
331 | 350 | // long mainLoopBeginTime = currentTimeMillis(); |
332 | 351 | // if (MainApp.getApplicationMode() == MainApp.Mode.SERVER) { |
333 | 352 | // if (MainApp.getGame().isGameEnded()) { |
@@ -94,7 +94,7 @@ | ||
94 | 94 | public static final int MAX_CONCURRENT_SOUNDS = 16; |
95 | 95 | public static final int MAX_SOUND_VOLUME = 100; |
96 | 96 | public static final int SOUND_LOWEST_PRIORITY = 999; |
97 | - private static final boolean DEBUG = true; | |
97 | + private static final boolean DEBUG = false; | |
98 | 98 | public static final boolean IGNORE_SOUND = false; // For faster loading on mobile |
99 | 99 | public static final boolean FORCE_PLAY = true; |
100 | 100 | private final HashMap<String, SoundInternal> sounds = new HashMap<>(); |
@@ -230,13 +230,17 @@ | ||
230 | 230 | // Remove sounds that have finished playing from the active sounds list. |
231 | 231 | removeFinishedSounds(); |
232 | 232 | |
233 | - System.out.println("Current active sounds num: " + activeSounds.size()); | |
234 | - System.out.println("Attempting to play " + soundToBePlayed.getName() + " with default priority " + soundToBePlayed.getPriority()); | |
233 | + if (DEBUG) { | |
234 | + System.out.println("Current active sounds num: " + activeSounds.size()); | |
235 | + System.out.println("Attempting to play " + soundToBePlayed.getName() + " with default priority " + soundToBePlayed.getPriority()); | |
236 | + } | |
235 | 237 | |
236 | 238 | // If we still have all sounds playing we need to try to make room for the new |
237 | 239 | // sound based on priority. |
238 | 240 | if (activeSounds.size() == MAX_CONCURRENT_SOUNDS) { |
239 | - System.out.println("Max concurrent sounds " + MAX_CONCURRENT_SOUNDS + " reached"); | |
241 | + if (DEBUG) { | |
242 | + System.out.println("Max concurrent sounds " + MAX_CONCURRENT_SOUNDS + " reached"); | |
243 | + } | |
240 | 244 | ActiveSound activeSoundWithLowestPriority = null; |
241 | 245 | for (ActiveSound activeSound : activeSounds) { |
242 | 246 | if (activeSoundWithLowestPriority == null || |
@@ -248,16 +252,20 @@ | ||
248 | 252 | // then we selected the one longest playing. If the new sound has the same |
249 | 253 | // priority then we evict the one with the same priority but longest playing. |
250 | 254 | if (activeSoundWithLowestPriority.getCurrentPriority() >= soundToBePlayed.getPriority()) { |
251 | - System.out.println("Evicting sound " + | |
252 | - activeSoundWithLowestPriority.getSound().getName() + | |
253 | - " with lowest priority " + | |
254 | - activeSoundWithLowestPriority.getCurrentPriority() + | |
255 | - " to make room for " + soundToBePlayed.getName() + | |
256 | - " with priority " + soundToBePlayed.getPriority()); | |
255 | + if (DEBUG) { | |
256 | + System.out.println("Evicting sound " + | |
257 | + activeSoundWithLowestPriority.getSound().getName() + | |
258 | + " with lowest priority " + | |
259 | + activeSoundWithLowestPriority.getCurrentPriority() + | |
260 | + " to make room for " + soundToBePlayed.getName() + | |
261 | + " with priority " + soundToBePlayed.getPriority()); | |
262 | + } | |
257 | 263 | activeSounds.remove(activeSoundWithLowestPriority); |
258 | 264 | stopSound(activeSoundWithLowestPriority.getSound(), activeSoundWithLowestPriority.getPlayId()); |
259 | 265 | } else { |
260 | - System.out.println("Sound " + soundToBePlayed.getName() + " with default priority " + soundToBePlayed.getPriority() + " could not be played"); | |
266 | + if (DEBUG) { | |
267 | + System.out.println("Sound " + soundToBePlayed.getName() + " with default priority " + soundToBePlayed.getPriority() + " could not be played"); | |
268 | + } | |
261 | 269 | return false; |
262 | 270 | } |
263 | 271 | } |
@@ -418,9 +426,12 @@ | ||
418 | 426 | for (Iterator<ActiveSound> iterator = activeSounds.iterator(); iterator.hasNext(); ) { |
419 | 427 | ActiveSound activeSound = iterator.next(); |
420 | 428 | if (activeSound.getPlayId() == id) { |
421 | - System.out.println("Removing sound by stopping " + activeSound.getSound().getName() + | |
422 | - " with play id " + activeSound.getPlayId() + | |
423 | - " and priority " + activeSound.getCurrentPriority()); | |
429 | + if (DEBUG) { | |
430 | + System.out.println("Removing sound by stopping " + activeSound.getSound().getName() + | |
431 | + " with play id " + activeSound.getPlayId() + | |
432 | + " and" + | |
433 | + " priority " + activeSound.getCurrentPriority()); | |
434 | + } | |
424 | 435 | iterator.remove(); |
425 | 436 | } |
426 | 437 | } |
@@ -419,12 +419,12 @@ | ||
419 | 419 | if (MainActivity.isDebugmode()) { |
420 | 420 | if (nativeObject instanceof ENG_MovableObject) { |
421 | 421 | ENG_MovableObject movableObject = (ENG_MovableObject) nativeObject; |
422 | - System.out.println("Ptr: " + ptr + " linked to movable object: " + movableObject.getName()); | |
422 | +// System.out.println("Ptr: " + ptr + " linked to movable object: " + movableObject.getName()); | |
423 | 423 | } else if (nativeObject instanceof ENG_Item) { |
424 | 424 | ENG_Item item = (ENG_Item) nativeObject; |
425 | - System.out.println("Ptr: " + ptr + " linked to item: " + item.getName()); | |
425 | +// System.out.println("Ptr: " + ptr + " linked to item: " + item.getName()); | |
426 | 426 | } else { |
427 | - System.out.println("Ptr: " + ptr + " linked to nativeObject class: " + nativeObject.getClass().getName()); | |
427 | +// System.out.println("Ptr: " + ptr + " linked to nativeObject class: " + nativeObject.getClass().getName()); | |
428 | 428 | } |
429 | 429 | } |
430 | 430 | if (put != null) { |
@@ -434,7 +434,7 @@ | ||
434 | 434 | ". Trying to add the same pointer with movable object: " + movableObject.getName()); |
435 | 435 | } else if (nativeObject instanceof ENG_Item) { |
436 | 436 | ENG_Item item = (ENG_Item) nativeObject; |
437 | - System.out.println("Ptr: " + ptr + " linked to item: " + item.getName()); | |
437 | +// System.out.println("Ptr: " + ptr + " linked to item: " + item.getName()); | |
438 | 438 | } else { |
439 | 439 | throw new IllegalArgumentException("Ptr: " + ptr + |
440 | 440 | " already linked to native object. nativeObject class: " + nativeObject.getClass().getName()); |
@@ -451,12 +451,12 @@ | ||
451 | 451 | if (MainActivity.isDebugmode()) { |
452 | 452 | if (remove instanceof ENG_MovableObject) { |
453 | 453 | ENG_MovableObject movableObject = (ENG_MovableObject) remove; |
454 | - System.out.println("removing Ptr: " + ptr + " linked to movable object: " + movableObject.getName()); | |
454 | +// System.out.println("removing Ptr: " + ptr + " linked to movable object: " + movableObject.getName()); | |
455 | 455 | } else if (remove instanceof ENG_Item) { |
456 | 456 | ENG_Item item = (ENG_Item) remove; |
457 | - System.out.println("removing Ptr: " + ptr + " linked to item: " + item.getName()); | |
457 | +// System.out.println("removing Ptr: " + ptr + " linked to item: " + item.getName()); | |
458 | 458 | } else { |
459 | - System.out.println("removing ptr: " + ptr + " nativeObject class: " + remove.getClass().getName()); | |
459 | +// System.out.println("removing ptr: " + ptr + " nativeObject class: " + remove.getClass().getName()); | |
460 | 460 | } |
461 | 461 | } |
462 | 462 | if (remove == null) { |
@@ -537,6 +537,7 @@ | ||
537 | 537 | try { |
538 | 538 | if (shouldSleepRenderingThread) { |
539 | 539 | shouldSleepRenderingThread = false; |
540 | +// System.out.println("Releasing rendering thread"); | |
540 | 541 | sleepRenderingThreadSemaphore.release(); |
541 | 542 | } |
542 | 543 |
@@ -1,2 +1,1 @@ | ||
1 | -ms256M | |
2 | -EnableGCHeapStats | |
\ No newline at end of file | ||
1 | +ms256M | |
\ No newline at end of file |