Closed Nokia64 closed 2 years ago
Looks okay, there are only two chances I'd make and they're mostly aesthetic. I'd change the ==
to >=
, just to be defensive, and I'd move the brace on that same line to it's own line, to match the modified Allman style used in the rest of the project.
Gameloft's Diamond Rush (tested version 240x320 v1.0.1,md5:
9cab3f7319f2f4853040b466884a7514
on FreeJ2ME f9f91e57e01ccd34438a1b509397b7bc4e1dd233) plays several WAV sound samples at certain gameplay events. Under FreeJ2ME each of the sounds plays only once, after what they stop workingUpon a closer look at the playback code in FreeJ2ME side's, found out the issue is related to the subsequent start() calls not rewinding the Clip back https://github.com/hex007/freej2me/blob/f9f91e57e01ccd34438a1b509397b7bc4e1dd233/src/org/recompile/mobile/PlatformPlayer.java#L287-L294 The actual rewinding is only performed while the player is still running but not after playback had finished, making the sound effectively unplayable after a full playback
This is the behaviour of the
start()
method as described by the MIDP-2.0 javadocs:I propose the following patch for the
start()
method to better match the specification (and fix this game 😉):If it seems okay I'll proceed opening a pull request with it Thank you!