Age | Commit message (Collapse) | Author |
|
exit_nicely() exits from the guile thread before it gets a chance
to exit() from the process as a whole.
And there's really nothing for the reporting-code in exit_nicely
to actually report at this point, anyway.
|
|
This handler got broken when exit_nicely stopped actually triggering
an exit from the entire process and started just exiting the guile thread.
And, actually, it never exited with an error-status before--
which it does now.
|
|
Streams that start out connected to non-tty FDs default to fully-buffered
and retain that configuration after those underlying FDs are redirected,
which prevents the "need to run from an xterm" fix from actually working
unless we do something like this to reset the stream buffers.
|
|
For those of us with difficulty seeing red,
it's just too hard to tell which way the robot is facing
when the only distinction is whether which of the side bumps
is red vs. grey (especially when it's just a handful of pixels).
|
|
Yet another of the niceties that comes out of just using guile's REPL
is that readline support is just figured out when building guile;
so by the time gnurobots is being built, readline support is either
there or it isn't--and even if our guile isn't readline-enabled,
we can still just run without readline (though, in practice,
I don't think I've ever seen a build of guile in the last 15 years
that didn't have readline...).
|
|
Since this GLib 1.35.1 was released >4 years ago
(which is presumably old enough to depend on it),
and the alternative is to drop Bradley's -Werror from AM_CFLAGS
and go back to using deprecated APIs.
|
|
Looks like these haven't been necessary since probably pkg-config 0.16,
12 years ago.
|
|
|
|
|
|
|
|
Move the GDK lock-management into the various arena action functions
so that we can release the lock _before_ sleeping in the guile thread,
allowing the GUI thread to update when the sleep starts
rather than when the sleep ends, so that the messages actually
stand a chance at remaining visible for something close to USLEEP_TIME--
rather than not showing until USLEEP_TIME has already expired.
Otherwise many of the updates get lost, e.g.:
(while (robot-feel "space") (robot-move 1))
... never seems to actually spend any time with the "Robot feels ..."
messages visible onscreen between the "Robot moves.." messages.
Note also that this change allows the GUI to generally be much more
responsive to user interaction (e.g.: scrolling, selection/copy/paste)
while a robot program is running!
|
|
|
|
This gives _much_ more useful readline behavior,
since (ice-9 readline) actually knows how to autocomplete
based on the scheme environment, handle multi-line input, etc.;
and properly displays return values and error-messages,
and supports switching to different front-end programming languages
like ecmascript.
Note that we're keeping catch_handler so that we have a chance
of diagnosing problems that could _conceivably_ occur
when interacting with guile during bootstrap
(e.g.: missing readline support, changed REPL API...).
|
|
|
|
This avoids weird off-by-1 errors in the GUI counters at game end.
|
|
Users should no longer need to run from an xterm to see
to see things like final energy/score/odometry stats,
map-file path, copyright, load-messages, etc.
Note that this also means we no longer need to redirect readline,
since we're just redirecting *everything*.
|
|
After some of the restructuring that was involved
in the inversion of the GTK+/guile threads,
these variables are no longer needed.
Though note that we do actually still busywait
specifically on creation of the map.
|
|
Making the GTK+ thread the main thread, and subordinating the guile thread,
lets the GUI continue to live after the robot has died--
which means that we'll be able to switch to just doing
everything in the GUI without requiring a separate xterm
to see the final stats after the robot dies.
|
|
This seems a lot more natural for scheme code.
|
|
|
|
Even if there's no movement to animate per se, we still want
to be able to see the energy/shields stats decrementing
as we bump into things--otherwise we might be surprised
when our robots suddenly dies with our counters all still
_apparently_ well above zero!
Note that we're still charging only 1 hit against energy and shields
per failed move *command* regardless of how many spaces
the robot was attempting to go....
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Using C99 is a bit of a mixed bag, but lets us more easily eliminate
warnings than other variants....
Earlier C variants have no "long long" type, which we don't even use
but is still a problem for us because there are some deprecated
function prototypes that come in through the libguile.h header
and *they* are defined in terms of "long long".
C99 criminalizes guile's behavior of passing function-pointers
via "void *"..., but we can work around that....
|
|
Necessary to support GUILE_FLAGS in guile 2.0
|
|
Fixes: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746000>
|
|
|
|
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|
|
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
|