summaryrefslogtreecommitdiffstats
path: root/src/jake2/sys/Sys.java
diff options
context:
space:
mode:
authorKenneth B. Russell <[email protected]>2008-03-02 20:21:15 +0000
committerKenneth B. Russell <[email protected]>2008-03-02 20:21:15 +0000
commit9323828a9f6118313d431f13a1f309da9c79ba09 (patch)
tree41a270b7d83a80cf03975ba8b5370587620e9991 /src/jake2/sys/Sys.java
parentebc94f975f45c2847eea390abf77ff768ce50e83 (diff)
Changes to enable Jake2 to run well as an applet inside the
next-generation Java Plug-In. Added Globals.appletMode, Globals.applet and Globals.sizeChangeListener to be able to easily pass around the knowledge that the system is running in applet mode, and the applet itself, which becomes the parent container for the output. Most changes were in Jsr231Driver to support putting the Display into a preexisting parent container rather than a new Frame each time. Changed JOGLKBD to allow manual initialization of the parent container rather than obtaining it from a CreateNotify or ConfigureNotify event since these will never be generated in the applet case. Removed various calls to System.exit(), although strictly speaking this is no longer necessary because it is expected that the separate_jvm parameter will be used in conjunction with the new Java Plug-In to create a fresh JVM instance for each run of Jake2. Video mode switching in applet mode is working; the applet resizes (via JavaScript) to accommodate the newly selected resolution. Full screen mode when running as an applet is not implemented at this point, as the intent was to show this inside the browser, though support could be added very straightforwardly.
Diffstat (limited to 'src/jake2/sys/Sys.java')
-rw-r--r--src/jake2/sys/Sys.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/jake2/sys/Sys.java b/src/jake2/sys/Sys.java
index 498750a..8ac8fb1 100644
--- a/src/jake2/sys/Sys.java
+++ b/src/jake2/sys/Sys.java
@@ -2,7 +2,7 @@
* Sys.java
* Copyright (C) 2003
*
- * $Id: Sys.java,v 1.11 2005-07-01 14:20:54 hzi Exp $
+ * $Id: Sys.java,v 1.12 2008-03-02 20:21:15 kbrussel Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -45,13 +45,17 @@ public final class Sys extends Defines {
CL.Shutdown();
//StackTrace();
new Exception(error).printStackTrace();
- System.exit(1);
+ if (!Globals.appletMode) {
+ System.exit(1);
+ }
}
public static void Quit() {
CL.Shutdown();
- System.exit(0);
+ if (!Globals.appletMode) {
+ System.exit(0);
+ }
}
//ok!
@@ -240,4 +244,4 @@ public final class Sys extends Defines {
System.out.print(msg);
}
-} \ No newline at end of file
+}