Commit Graph
100 Commits
Author SHA1 Message Date
PSp..om 4e12127f27 Remove the fragile camNode.getControl(0).setEnabled()
and replaced it with camNode.setEnabled().
A) it is kind of scary to rely on the control index in
this case.
B) CameraNode.setEnabled() already calls setEnabled()
on the CameraControl.
An acceptable alternative would be:
camNode.getControl(CameraControl.class).setEnabled()
but I didn't see the point of it.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9267 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-03-29 18:45:47 +00:00
PSp..om 511a11fc7c Moved the creation of the guiFont into a separate
method that can be overridden by subclasses.
This isn't really complicated enough to move to
an app state and the fact that the field is 
exposed is already sort of "unclean" anyway.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9240 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-03-09 07:12:29 +00:00
PSp..om 2bde71b08a Early out on initializePending and terminatePending
if the array is empty.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9233 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-03-05 19:22:33 +00:00
PSp..om 5cf9954814 Added a comment with what I think the taskQueue
drain method is really doing... only simplified.
I don't trust my eyes enough to make such a core
change without co-verification. :)


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9218 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-28 01:44:13 +00:00
PSp..om dde5d0a510 Added a ResetStatsState so that the stats are always
reset even if the developer has overridden simpleUpdate().
As long Application's stateManager is run, the stats will
get reset no matter how many views there are or if they
are disabled or not.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9213 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-26 01:27:07 +00:00
PSp..om 54471475fe Added a test showing the basic app state life cycle
and verifying that all steps get called when they
are supposed to.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9212 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-26 00:58:50 +00:00
PSp..om f07446e0d4 Added an accessor for the stats view object.
Necessary if you want to move these things around
to different places on the screen.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9184 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-21 04:44:58 +00:00
PSp..om 72561e7a8b Made the app-states taking constructor more defensive
so that it can be called with null in various ways
without throwing NPEs.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9167 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 04:20:14 +00:00
PSp..om dac2de12c6 Moved the debug key handling to its own app state.
Also fixed a bug in some SimpleApplication subclasses
that expect access to the guiFont and fpsText from
simpleInit.  This is why some believe protected fields
are the work of the devil. ;)


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9166 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 04:11:21 +00:00
PSp..om c084f0a025 FlyByCamera modified to check if its mappings exist
before unregistering them.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9165 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 03:57:23 +00:00
PSp..om e7f0a5ad91 Since input manager throws an exception when trying
to delete non-existent mappings, and since I'm loathe
to change this behavior even though I kind of don't
agree with it...
instead, I've added a hasMapping() method so that
callers can avoid deleting non-existant mappings
without having to do all of their own book-keeping.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9164 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 03:56:41 +00:00
PSp..om d440f70d92 SimpleApp now uses FlyCamAppState to manage its
camera (by default).  If the app state doesn't
exist then the camera doesn't get created.  Due
to the volume of apps that will expect a working
camera in simpleInit(), it wasn't possible to
do this as a purely separate app state.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9163 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 02:17:44 +00:00
PSp..om 0c835eae80 Modified fly cam to be a little more resilient
in the face of being called before it sees an
input manager.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9162 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 02:14:03 +00:00
PSp..om fef809b3f0 Removing some empty methods that I left in by
mistake.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9161 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 01:40:48 +00:00
PSp..om f9ab14b751 Added a method to unregister from the input manager.
Untested and incomplete because some things can't
be undone.  Better than nothing.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9160 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 01:34:48 +00:00
PSp..om 4c18bfaecb Moved the stats view stuff out into an app state
that is added automatically as part of simple app
construction.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9159 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 01:12:10 +00:00
PSp..om a2043b3ded Modified to tracks its enabled state so that it
can really be disabled.  I will move the 
statistics.clearFrame() on my next commit.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9158 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 01:05:50 +00:00
PSp..om 05a88493a8 Added an accessor for Timer.
Moved the creation of the state manager into
the constructor.  Logically it should exist
as early as possible.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9157 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 00:19:13 +00:00
PSp..om 07d5451a31 Removed the direct accessing of the seconds counter
so that I don't break the build with my next changes.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9156 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 00:07:45 +00:00
PSp..om 4e616d9360 Use the display flag setters and removed the
clearing of secondsCounter since I couldn't see
that it was used anywhere.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9155 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 00:06:23 +00:00
PSp..om 500896e935 Modified to use the display flag accessor instead
of directly culling the BitmapText.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9154 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 00:05:30 +00:00
PSp..om 6240a51173 Removed the loadStatsView and loadFpsText because
they are essentially going away and because I 
couldn't see what changes were in this class to 
need the override.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9153 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-17 00:02:46 +00:00
PSp..om 65f8dbf6ae For the cases where a define has not actually
changed, don't reload the shader.  This prevents
a lot of extra work from being done.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9139 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-07 11:04:46 +00:00
PSp..om 1f0a77de26 Modified the define list to only recompile if
values have changed.  Also, it returns a boolean
for set and remove on whether a change actually
occurred.  This will be used by my next commit
to give a performance boost.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9138 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-07 11:03:53 +00:00
PSp..om 4edf262021 Fixed FloatBuffer support as well as other
buffers that are views of other buffers and
follow the same conventions.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9127 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-01 22:59:36 +00:00
PSp..om ebb2fca18f Renamed the destroyByteBuffer method to destroyDirectBuffer
because it more appropriately says what it does and this is
a relatively new method.  After changing it to work with
any direct buffer it seemed inappropriately named.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9121 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-30 10:49:40 +00:00
PSp..om 9ecaf0b96e Expand the destroyByteBuffer() call to take any
Buffer and do a safety check for isDirect().
This should let it free FloatBuffers, etc.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9120 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-30 10:37:30 +00:00
PSp..om 38f56d3f2e GeometryBatchFactory now bulk copies the untransformed
buffers instead of copying them one element at a time.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9101 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-19 06:22:09 +00:00
PSp..om 1545a83abb Implemented a more efficient way of bulk copying
a vertex buffer's elements to another.
Also modified copyElement to call the new copyElements
call with a size of 1... since they were nearly identical
minus the * len mods.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9100 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-19 06:21:25 +00:00
PSp..om e6dc1b7183 Modified GeometryBatchFactory to be thread safe
from other readers of the meshes upon which it is
operating.  At least in theory.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9099 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-19 06:08:50 +00:00
PSp..om 606b676d69 Modified so that read-only operations will not
clobber each other if done from other threads
and provided a way to safely access the whole
buffer if only read-only access is required.
Round 1 of a fix for GeometryBatchFactory...


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9098 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-19 05:57:43 +00:00
PSp..om 1083cbd5aa Removed the extraneous warning message since you will
get an exception with the same info (and it's not a 
warning anyway, it's fatal).
Also improved the error message to include the field
that failed to write.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8960 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-28 07:05:16 +00:00
PSp..om 5ed66f47e7 Redoing some of the isConnected checking and connection
close logging to be less verbose... and to not print out
logged infos that look like warnings about "connections
already being closed."
While I was at it, I added so FINE logging about the
sizes of the maps when the elements are removed to make
sure everything is being cleaned up properly.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8944 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-19 10:41:38 +00:00
PSp..om 010b9e0670 Until I can hook up proper error handlers, at least close
the connection so the clients don't hang around in an errored
state.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8943 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-17 11:40:24 +00:00
PSp..om dc46e28eb9 Added a big honking warning after learning something in
hindsight about the removal of RenderingHints. :P
Seemed simple enough... but now I have to watch people
get connection errors to my server instead of getting
a nice kick.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8942 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-17 11:21:13 +00:00
PSp..om d1576a3580 Added a proper toString() to SerializerRegistration.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8941 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-17 11:14:15 +00:00
PSp..om 4c2ccc66e0 Added a toString method similar to AbstractCollection's.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8940 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-17 07:07:15 +00:00
PSp..om e84d8300dd Modified Client/Server to support alternate channels. The
server can configure additional ports that will be sent to
the client upon connection.  These channels can be used to
send messages in parallel to the normal messages.  This is
useful to keeping several separate command pathways flowing
smoothly despite potentially large messages on one channel.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8938 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 10:28:50 +00:00
PSp..om 665a7c8851 A small formatting change.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8937 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 10:27:26 +00:00
PSp..om c686efc3a7 DefaultClient now also deals with connectors more
generically as channels.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8936 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 09:19:17 +00:00
PSp..om fe1bd03c51 Unified how UDP and TCP kernels are handled into a
more general "channel" list.  This is to pave the way
for additional channels.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8935 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 08:43:33 +00:00
PSp..om 2d0def329d Made the UDP disconnect events more timely by including
the same bump logic that the NIO kernel has.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8934 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 08:30:42 +00:00
PSp..om 5cb7e21157 Modified KernelAdapter to be a more self-sufficient adapter
to better support having multiple channels.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8933 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 07:14:47 +00:00
PSp..om 48db901b5b Added a method for easily determining if there are active
connections.
Early-return in the broadcast method if there are no connections.
This prevents allocation of a message if it's just going to get
dropped on the floor anyway.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8932 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 00:31:40 +00:00
PSp..om 7a333dda9f On some platforms the selector will not automatically wake up
when the network connection has been closed.  Forcing the selector
to wake up seems to be safe on tested platforms.
Thanks to @philotomy for the catch and fix.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8669 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-11-14 10:51:25 +00:00
PSp..om d2e2935d90 Default the application timer to NanoTimer. I did this
during construction so that the default JmeContext timer
could potentially still be used by calling app.setTimer(null)
from an apps main().  In that case, the previous behavior
of pulling the timer from JmeContext during init would happen.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8588 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-11-07 00:25:29 +00:00
PSp..om b13809bba3 Fixed the line segment extents so that it doesn't act twice
as long as it's supposed to be.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8542 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-29 09:13:29 +00:00
PSp..om cf18f48182 Internal surgery to AppStateManager to provide more
consistent app state lifecycle, fix some state transition
related bugs, and stop confusing users... well, at least
confusing them less hopefully.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8524 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-24 21:14:25 +00:00
PSp..om 2a65ca4cb7 Added a setTimer() method for switching the default
Timer implementation.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8523 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-24 19:31:50 +00:00
PSp..om d2579343b2 Make BitmapFont's calculation of line width match
BitmapText's version.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8475 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-21 09:07:27 +00:00
PSp..om 1e59de25ee Took out the unbaking of kerning because it _does_
affect all subsequent cursor positions unlike xOffset.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8474 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-21 08:53:02 +00:00
PSp..om 68c2fea479 The last change neglected the first character which
has special treatment for its x0 setting but still
requires that the xAdvance be adjusted to account
for accumulated xOffset.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8473 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-21 08:44:25 +00:00
PSp..om ee2f44f340 Fixed some really odd text advance behavior that
caused letters and characters to overlap each other.
Basically, the offset was being included in the next
chars position... and it shouldn't be.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8472 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-21 08:27:09 +00:00
PSp..om c548987709 Removing the deprecated packages and old version of the
networking layer.  Note: because some messages were removed
from Serializer's auto-registration this version is not
binary-compatible with the last.  So you must upgrade your
client and server at the same time.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8286 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-24 09:16:54 +00:00
PSp..om 878d997a4e Removing deprecated references.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8285 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-24 09:15:15 +00:00
PSp..om 7c77fc404b Removing deprecated networking code.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8284 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-24 09:14:34 +00:00
PSp..om 3f6461a4a8 Made the static utility methods static. "D'oh!"
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8257 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-16 09:02:13 +00:00
PSp..om 1dbd617d2d Added a method to register classes in bulk.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8069 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-24 09:52:35 +00:00
PSp..om 8f90e62fec A change from a while back that presents a slightly better
error message than an NPE but still isn't very helpful.  This
usually only happens when things are totally confused, ie:
stream corruption or more likely misregistered classes.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8068 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-24 09:38:28 +00:00
PSp..om de8053c740 Removing this directory until the person who committed
the three different cases of Rock.PNG can check in the
right ones.  Otherwise, no one on a non unix OS can
update SVN. :P


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8064 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-23 11:42:07 +00:00
PSp..om b3e488ff76 Fixed to properly update the buffer when the extents
are changed.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8008 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-14 10:46:54 +00:00
PSp..om d67adb8266 Pulled the ExecutorService stuff out and replaced it with a
plain single thread.  This gives more control over the queuing
behavior as with an ThreadPoolExecutor it is difficult to implement
blocking execute() behavior.  Also, this avoids creating an
extra object per-message.
Anyway, this code now implements a blocking queue instead of
a boundless queue.  It's set to 16,000 messages which should only
bottom out in the worst of cases.  I was seeing it in the throughput
tests where the sockets were backing up and the queues were 
consuming all of the heap until an out of memory error occurred.
Outbound messaging is only throttled this way on the client.
Servers typically wouldn't do this sort of spamming anyway.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7977 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-05 07:55:04 +00:00
PSp..om d62c1311fb Fixed a long-standing but well hidden bug in message
protocol.  In the wild, I've only seen this crop up in
really really odd circumstances.  As it turns out, the 
throughput tests eventually trigger this when testing
TCP.  I've lost sleep over wondering when this was going
to bite for real so I'm glad to have what is essentially
the last known bug in message transfer fixed.
This change handles the case where so far only one
byte of the two byte message size has been read from
the network.  Rare, but it can happen.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7976 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-05 06:46:56 +00:00
PSp..om 1bbbc3b0bb Fixed a typo in the comment. OCD strikes again.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7900 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-22 09:13:40 +00:00
PSp..om 7ea2f54286 Turning the memory tracking off since it's pretty expensive
and broken anyway.  See comment in source.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7899 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-22 09:12:11 +00:00
PSp..om 1e8dea8eba Made the methods called from the audio thread final because
no good can come from overriding them.  Also made those
variables volatile so that other threads are guaranteed to
see the right values.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7874 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-17 21:55:29 +00:00
PSp..om 287bc0167c Added an AudioContext to hold the thread local audio
renderer as set by the application update().  a) this
ensures that the audio node must be updated on the render
thread like everything else, b) it means that audio node
doesn't need to juggle its own reference to AudioRenderer
since from the right thread it can always get at it.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7873 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-17 21:24:11 +00:00
PSp..om bb18399b6d Made the math classes (most of them) java.io.Serializable
since it's harmless and makes these math classes more useful
as general data structures.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7860 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-15 00:23:21 +00:00
PSp..om dd5d56ab42 Return the base color for BitmapText.getColor() because
other things make less sense... though no answer is
exactly "right".


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7859 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-14 11:23:04 +00:00
PSp..om 349c9d9e4a Modified to use the new SafeArrayList for children and controls.
This means it is possible for a control to modify its own
node hierarchy in a way that might have caused random skipping
at best and index out of bounds exceptions at worse.
Also, users can iterate over children and detach them at the
same time using standard for each constructs.
Performance is the same for me though I'd expected it to be
at least slightly faster given that most inner loops now use
direct array access.  My scenes must not exploit this much.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7857 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-13 08:01:39 +00:00
PSp..om 11ab79a766 Added a custom array-based List class that buffers modifications
in such a way that the list can be modified while being iterated.
Furthermore, it exposes the raw array "snapshot" for iteration
simplifying some code elsewhere.
I've left comments in the code as to some beneficial mods that
could be made for the target use-cases.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7856 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-13 07:55:34 +00:00
PSp..om a0dea25ec5 Fixed an event ordering issue. The server now only
first the connection added event after sending the
connect confirmation to the client.  This prevents
a resource deadlock if the connection listener
tries to send a message to the client and the
client tries to send a response back... since the
client won't have been fully initialized yet.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7854 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-12 20:07:11 +00:00
PSp..om 68bac95cd5 Added some more information to the logging.
Removed an errant nextId decrement that would occur
even if the class was already registered and already
had an ID.  This makes the teetering tower of glass
shards slightly less fragile... slightly.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7722 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-06-24 10:06:41 +00:00
PSp..om 98267c3d0f Added a check for no-arg constructor during initialize
to avoid having to wait to find this out until a message
is sent.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7694 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-06-23 08:19:06 +00:00
PSp..om 85d711ccd2 Converted the raw input listener loop to use a
cached array copy of the raw input listener list.
This prevents the whole thing from blowing up if
a RawInputListener is removed as the result of a
raw input event.  It's also ever so slightly faster.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7543 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-06-02 07:23:54 +00:00
PSp..om 71df4f9acd Client will log the exception that causes it to disconnect
just in case the caller has not registered any listeners.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7525 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-25 20:33:59 +00:00
PSp..om c75f157cbb Sort of fixed a streaming related memory leak. Well,
streams won't leak anymore but the buffered case
technically will if you create them and drop them because
that's a different level of fix.
Also made the deleteAudioData synchronized since it can
be called from another thread pretty trivially.
And fixed a race condition that caused an IndexOutOfBounds
exception if you happen to try adjusting an AudioNode's
parameters right as it was finishing playing.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7506 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-16 22:59:49 +00:00
PSp..om 743ecf650e Fixed a comment to be more accurate. Max distance
is not the maximum distance for the sound to be
heard but the maximum distance that it will be
attenuated.  In other words, setting max distance
to a small value has the opposite effect of cutting
off the sound early.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7496 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-15 05:42:54 +00:00
PSp..om 2f415f3919 Fix an index out of bounds exception when moving an
audio node that hasn't been played yet.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7495 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-15 05:06:34 +00:00
PSp..om 945683f432 Fixed positional audio to actually be positional.
Prior to this change, all positional audio was relative
to the listener.  So no amount of moving around or
turning of the head was going to make the sound any
different.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7494 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-15 04:57:54 +00:00
PSp..om e6c9cbac12 Modified the setAttribute() method to remove the attribute
if the value is null instead of throwin an NPE.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7485 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-11 17:12:01 +00:00
PSp..om 9489d43098 If reverb was enabled then the effect channel association
needs to be cleared, regardless of whether there was a 
filter or not.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7482 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-10 20:43:41 +00:00
PSp..om 8ed2db29a6 Reworked how client connection teardown happens in the face
of the network connection disappearing or any other random errors
on the channel.  Now errors that cause the connection to drop
will be properly reported as client disconnects... there is also
a new error field on the DisconnectInfo that is filled in in these
cases.
Added an ErrorListener that can be used to more tightly control
how errors are handled for the Client.
Fixed the double event dispatch that occurred during Client
closing.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7451 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-05 05:59:52 +00:00
PSp..om 95315cfd0c Fixing a pretty significant typo.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7450 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-05 05:49:18 +00:00
PSp..om 17221395dc The KernelAdapter now keeps a rolling message buffer
for the endpoints when using a reliable connection.
There is no guarantee that the buffers going out from
a client won't be chopped up by the networking stack
in various ways.  It was always the intent to accumulate
them like this (the client side already does after all)
but it was an oversight.  It's a testament to modern
networking that this hasn't come up in practice yet.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7449 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-05 05:07:28 +00:00
PSp..om 1b837fe7ea Make client-side background threads daemon.
Reduced the amount of logging from invalid UDP messages
received.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7314 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-26 21:53:49 +00:00
PSp..om 2bc6e27200 Proper fix for the bug where JME's quaternion wasn't
being serialized automatically.
When a class is final and in the field of a class that
is registered, it is safe to register it automatically
because the type can be determined reliably on the
other end of the stream.  So now it allows that.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7276 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-20 17:41:15 +00:00
PSp..om d0a5ce55b9 Moved some exception handling to terminate connections
that throw low level exceptions.  The specific case I
saw for this was "An existing connection was forcibly
closed by the remote host" IOException.  Without this
new handling, SM continually tried to send the connection
its data.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7260 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 17:27:11 +00:00
PSp..om 9073820361 Reuse one big buffer per thread and copy the outbound
smaller buffers.  Way faster and way cheaper overall.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7259 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 05:56:52 +00:00
PSp..om 85b4eea8d7 Name the executor threads based on something that might
be useful to someone debugging thread dumps. ;)


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7258 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 03:48:41 +00:00
PSp..om 7d6d513fa5 Modified the DefaultClient (really its ConnectionAdapters)
to send their outbound data on a background thread.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7257 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 03:17:18 +00:00
PSp..om e298a4357e Modified the toString() for UdpEndpoint to include
the address instead of the socket... since they all share
the same socket anyway and the datagram sockets don't 
have useful toString()s.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7256 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-17 21:14:41 +00:00
PSp..om 5225599ee2 Fixed a case where an exception would kill the kernel
adapter thread.  Also improved the details of the error
logging.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7255 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-17 21:04:09 +00:00
PSp..om 593d9bf35a UDP-based kernel now does its writes on a background
thread.  Most of the time UDP packets go right out
but not always... depending on the network layer it can
take a couple of milliseconds.  And that's alot when
you're blasting packets out to a dozen users 20 times
a second.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7245 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-16 03:51:43 +00:00
PSp..om 1f1c2ac15b Tightened up the DefaultServer connection close code
to make sure that the connection closed change event
only goes out once.
Added some additional logging to the endpoint closings.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7244 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-16 01:54:51 +00:00
PSp..om 189a787d36 Added some warning for some odd state issues that can happen
in real life.
Fixed a subtle bug with the UDP endpoints where they weren't
getting propery closed.  This manifested as the endpoints
still getting broadcasts even after Server no longer knew
about them.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7243 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-16 00:13:25 +00:00
PSp..om 255fe9f9c9 Turned the magic input mapping strings into constants to
make it easier to unbind them if desired.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7242 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-14 03:43:02 +00:00
PSp..om c5ac1c8bfe Modified to throw an exception if the class of the object
being written hasn't been registered yet and does not
have an explicit ID set.  The old way would try to send
it anyway and then it would fail to get received on the
other end.
A setStrictRegistration(false) method can be used to get the
old behavior if needed.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7222 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-09 08:07:25 +00:00
PSp..om f9c321e6e9 Reduced the scope of the synchronized block to something
more reasonable (rather than essentially encompassing the
entire application if you build your app around AppStates)
but the realy benefit is now the app states can add/remove
other app states without random oddness happening.
...and it's ever so slightly more efficient now, too.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7220 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-08 03:55:57 +00:00
PSp..om 0f1b05b405 Fixed the few uncheck warnings that I could... suppressed
the rest.  Added an UnsupportedOperationException to 
SerializableSerializer so that it doesn't silently fail
to do anything at all.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7219 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-08 02:55:21 +00:00