|
From: <ka...@us...> - 2010-07-11 13:03:22
|
Revision: 3373
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3373&view=rev
Author: kappa1
Date: 2010-07-11 13:03:16 +0000 (Sun, 11 Jul 2010)
Log Message:
-----------
AppletLoader: fix code to compile on java 1.4
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-11 12:13:34 UTC (rev 3372)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-11 13:03:16 UTC (rev 3373)
@@ -1006,7 +1006,7 @@
if (cacheEnabled && lastModified != 0 &&
filesLastModified.containsKey(fileName)) {
- long savedLastModified = (Long)filesLastModified.get(fileName);
+ long savedLastModified = ((Long)filesLastModified.get(fileName)).longValue();
// if lastModifed time is the same, don't redownload
if (savedLastModified == lastModified) {
@@ -1019,7 +1019,7 @@
}
// put key and value in the hashmap
- filesLastModified.put(fileName, lastModified);
+ filesLastModified.put(fileName, new Long(lastModified));
// update progress bar
percentage = 5 + (int)(10 * i/(float)urlList.length);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-11 13:54:58
|
Revision: 3374
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3374&view=rev
Author: kappa1
Date: 2010-07-11 13:54:52 +0000 (Sun, 11 Jul 2010)
Log Message:
-----------
Appletloader: fix caching issue with native jars
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-11 13:03:16 UTC (rev 3373)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-11 13:54:52 UTC (rev 3374)
@@ -544,7 +544,7 @@
case STATE_DETERMINING_PACKAGES:
return "Determining packages to load";
case STATE_CHECKING_CACHE:
- return "Calculate download size and check cache";
+ return "Calculating download size";
case STATE_DOWNLOADING:
return "Downloading packages";
case STATE_EXTRACTING_PACKAGES:
@@ -1286,6 +1286,11 @@
*/
protected void extractNatives(String path) throws Exception {
+ // if no new native jar was downloaded, no extracting needed
+ if (fileSizes[fileSizes.length-1] == -2) {
+ return;
+ }
+
state = STATE_EXTRACTING_PACKAGES;
int initialPercentage = percentage;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-11 15:26:39
|
Revision: 3375
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3375&view=rev
Author: kappa1
Date: 2010-07-11 15:26:33 +0000 (Sun, 11 Jul 2010)
Log Message:
-----------
AppletLoader: fix issue with caching and lzma/pack200 files
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-11 13:54:52 UTC (rev 3374)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-11 15:26:33 UTC (rev 3375)
@@ -1251,6 +1251,10 @@
float increment = (float) 10.0 / urlList.length;
// extract all lzma and pack.lzma files
for (int i = 0; i < urlList.length; i++) {
+
+ // if file has not changed, skip it
+ if (fileSizes[i] == -2) continue;
+
percentage = 55 + (int) (increment * (i+1));
String filename = getFileName(urlList[i]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-12 20:02:02
|
Revision: 3378
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3378&view=rev
Author: kappa1
Date: 2010-07-12 20:01:56 +0000 (Mon, 12 Jul 2010)
Log Message:
-----------
AppletLoader: Remove the boxerrorcolor parameter, there is not much advantage in having different color error message font, its better to have a nice consistent error message then to try scare the user. Also simplifies the AppletLoader api by reducing the number of parameters.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-12 12:04:56 UTC (rev 3377)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-12 20:01:56 UTC (rev 3378)
@@ -110,7 +110,7 @@
* <ul>
* <li>al_version - [int or float] Version of deployment. If this is specified, the jars will be cached and
* reused if the version matches. If version doesn't match all of the files are reloaded.</li>
- * <li>al_cache - [boolean] Whether to use cache system. If al_version is used then cache is not used. <i>Default: true</i>.</li>
+ * <li>al_cache - [boolean] Whether to use cache system. <i>Default: true</i>.</li>
* <li>al_debug - [boolean] Whether to enable debug mode. <i>Default: false</i>.</li>
* <li>al_prepend_host - [boolean] Whether to limit caching to this domain, disable if your applet is hosted on multple domains and needs to share the cache. <i>Default: true</i>.</li>
* <ul>
@@ -121,7 +121,6 @@
* <ul>
* <li>boxbgcolor - [String] any String AWT color ("red", "blue", etc), RGB (0-255) or hex formated color (#RRGGBB) to use as background. <i>Default: #ffffff</i>.</li>
* <li>boxfgcolor - [String] any String AWT color ("red", "blue", etc), RGB (0-255) or hex formated color (#RRGGBB) to use as foreground. <i>Default: #000000</i>.</li>
- * <li>boxerrorcolor - [String] any String AWT color ("red", "blue", etc), RGB (0-255) or hex formated color (#RRGGBB) to use as foreground color on error. <i>Default: #ff0000</i>.</li>
* </ul>
* </p>
* @author kappaOne
@@ -190,9 +189,6 @@
/** background color of applet */
protected Color bgColor = Color.white;
-
- /** Color to write errors in */
- protected Color errorColor = Color.red;
/** color to write foreground in */
protected Color fgColor = Color.black;
@@ -288,10 +284,8 @@
// get colors of applet
bgColor = getColor("boxbgcolor", Color.white);
setBackground(bgColor);
+ fgColor = getColor("boxfgcolor", Color.black);
- fgColor = getColor("boxfgcolor", Color.black);
- errorColor = getColor("boxerrorcolor", Color.red);
-
// load logos
logo = getImage(getParameter("al_logo"));
progressbar = getImage(getParameter("al_progressbar"));
@@ -462,7 +456,6 @@
int messageX = (offscreen.getWidth(null) - fm.stringWidth(errorMessage[i])) / 2;
int messageY = (offscreen.getHeight(null) - (fm.getHeight() * errorMessage.length)) / 2;
- og.setColor(errorColor);
og.drawString(errorMessage[i], messageX, messageY + i*fm.getHeight());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-12 20:19:27
|
Revision: 3379
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3379&view=rev
Author: kappa1
Date: 2010-07-12 20:19:21 +0000 (Mon, 12 Jul 2010)
Log Message:
-----------
AppletLoader: slightly more meaningful and friendly error message.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-12 20:01:56 UTC (rev 3378)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-12 20:19:21 UTC (rev 3379)
@@ -1535,7 +1535,7 @@
*/
protected void fatalErrorOccured(String error, Exception e) {
fatalError = true;
- fatalErrorDescription = "Fatal error occured (" + state + "): " + error;
+ fatalErrorDescription = "This occurred while '" + getDescriptionForState() + "'";
System.out.println(fatalErrorDescription);
if(e != null) {
System.out.println(generateStacktrace(e));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-15 20:00:47
|
Revision: 3383
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3383&view=rev
Author: kappa1
Date: 2010-07-15 20:00:41 +0000 (Thu, 15 Jul 2010)
Log Message:
-----------
AppletLoader - slight tweak to make AppletLoader looks a bit better
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-15 19:43:11 UTC (rev 3382)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-15 20:00:41 UTC (rev 3383)
@@ -1086,7 +1086,7 @@
// round to two decimal places
downloadSpeed = ((int)(downloadSpeed*100))/100f;
// set current speed message
- downloadSpeedMessage = " @ " + downloadSpeed + " KB/sec";
+ downloadSpeedMessage = " - " + downloadSpeed + " KB/sec";
// reset downloaded amount
downloadedAmount = 0;
// reset start time
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-21 18:53:50
|
Revision: 3385
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3385&view=rev
Author: kappa1
Date: 2010-07-21 18:53:41 +0000 (Wed, 21 Jul 2010)
Log Message:
-----------
AppletLoader: fix bug with LWJGL 2.5 where appletloader crashed if the al_version parameter was used.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-15 21:58:06 UTC (rev 3384)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-21 18:53:41 UTC (rev 3385)
@@ -737,7 +737,7 @@
// save version information once jars downloaded successfully
if (version != null) {
percentage = 90;
- writeVersionFile(dir, latestVersion);
+ writeVersionFile(versionFile, latestVersion);
}
// save file names with last modified info once downloaded successfully
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-24 20:01:04
|
Revision: 3386
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3386&view=rev
Author: kappa1
Date: 2010-07-24 20:00:58 +0000 (Sat, 24 Jul 2010)
Log Message:
-----------
AppletLoader: clean up resources (images) when switching to the LWJGL Applet as opposed to when applet is destroyed
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-21 18:53:41 UTC (rev 3385)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-24 20:00:58 UTC (rev 3386)
@@ -368,12 +368,19 @@
if (lwjglApplet != null) {
lwjglApplet.destroy();
}
-
+ }
+
+ /**
+ * Clean up resources
+ */
+ protected void cleanUp() {
progressbar = null;
logo = null;
logoBuffer = null;
progressbarBuffer = null;
+
+ offscreen = null;
}
/**
@@ -501,6 +508,9 @@
*/
public boolean imageUpdate(Image img, int flag, int x, int y, int width, int height) {
+ // finish with this ImageObserver
+ if (state == STATE_DONE) return false;
+
// if image frame is ready to be drawn and is currently not being painted
if (flag == ImageObserver.FRAMEBITS && !painting) {
Image buffer;
@@ -750,7 +760,9 @@
// switch to LWJGL Applet
switchApplet();
- state = STATE_DONE;
+ state = STATE_DONE;
+ // clean up resources
+ cleanUp();
} catch (AccessControlException ace) {
fatalErrorOccured(ace.getMessage(), ace);
certificateRefused = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-25 11:41:05
|
Revision: 3387
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3387&view=rev
Author: kappa1
Date: 2010-07-25 11:40:58 +0000 (Sun, 25 Jul 2010)
Log Message:
-----------
AppletLoader: fix error message so that it actually uses the error message string.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-24 20:00:58 UTC (rev 3386)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-25 11:40:58 UTC (rev 3387)
@@ -211,9 +211,6 @@
/** whether a fatal error occured */
protected boolean fatalError;
- /** fatal error that occured */
- protected String fatalErrorDescription;
-
/** whether we're running in debug mode */
protected boolean debugMode;
@@ -454,10 +451,6 @@
if (fatalError) {
String[] errorMessage = (certificateRefused) ? certificateRefusedMessage : genericErrorMessage;
- if (!certificateRefused) {
- errorMessage[errorMessage.length-1] = fatalErrorDescription;
- }
-
for(int i=0; i<errorMessage.length; i++) {
if(errorMessage[i] != null) {
int messageX = (offscreen.getWidth(null) - fm.stringWidth(errorMessage[i])) / 2;
@@ -767,7 +760,7 @@
fatalErrorOccured(ace.getMessage(), ace);
certificateRefused = true;
} catch (Exception e) {
- fatalErrorOccured(e.getMessage(), e);
+ fatalErrorOccured("This occurred while '" + getDescriptionForState() + "'", e);
} finally {
loaderThread = null;
}
@@ -1547,9 +1540,10 @@
*/
protected void fatalErrorOccured(String error, Exception e) {
fatalError = true;
- fatalErrorDescription = "This occurred while '" + getDescriptionForState() + "'";
- System.out.println(fatalErrorDescription);
+ genericErrorMessage[genericErrorMessage.length-1] = error;
+ System.out.println(error);
if(e != null) {
+ System.out.println(e.getMessage());
System.out.println(generateStacktrace(e));
}
repaint();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-25 12:18:23
|
Revision: 3388
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3388&view=rev
Author: kappa1
Date: 2010-07-25 12:18:17 +0000 (Sun, 25 Jul 2010)
Log Message:
-----------
AppletLoader: actually fail with error message if logo images are not found or an error occurs when they are loaded, added missing MediaTracker step. Also prevent paint thread from null pointer exception when this happens.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-25 11:40:58 UTC (rev 3387)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-25 12:18:17 UTC (rev 3388)
@@ -405,7 +405,6 @@
* @see java.awt.Container#paint(java.awt.Graphics)
*/
public void paint(Graphics g) {
-
// don't paint loader if applet loaded
if(state == STATE_DONE) {
return;
@@ -416,16 +415,21 @@
offscreen = createImage(getWidth(), getHeight());
// create buffers for animated gifs
- logoBuffer = createImage(logo.getWidth(null), logo.getHeight(null));
- progressbarBuffer = createImage(logo.getWidth(null), logo.getHeight(null));
+ if (logo != null) {
+ logoBuffer = createImage(logo.getWidth(null), logo.getHeight(null));
+ // add image observer, it will notify when next animated gif frame is ready
+ offscreen.getGraphics().drawImage(logo, 0, 0, this);
+ // in case image is not animated fill image buffer once
+ imageUpdate(logo, ImageObserver.FRAMEBITS, 0, 0, 0, 0);
+ }
- // add image observer, it will notify when next animated gif frame is ready
- offscreen.getGraphics().drawImage(logo, 0, 0, this);
- offscreen.getGraphics().drawImage(progressbar, 0, 0, this);
-
- // in case image is not animated fill image buffers once
- imageUpdate(logo, ImageObserver.FRAMEBITS, 0, 0, 0, 0);
- imageUpdate(progressbar, ImageObserver.FRAMEBITS, 0, 0, 0, 0);
+ if (progressbar != null) {
+ progressbarBuffer = createImage(progressbar.getWidth(null), progressbar.getHeight(null));
+ // add image observer, it will notify when next animated gif frame is ready
+ offscreen.getGraphics().drawImage(progressbar, 0, 0, this);
+ // in case image is not animated fill image buffer once
+ imageUpdate(progressbar, ImageObserver.FRAMEBITS, 0, 0, 0, 0);
+ }
}
// draw everything onto an image before drawing to avoid flicker
@@ -436,14 +440,6 @@
og.setColor(bgColor);
og.fillRect(0, 0, offscreen.getWidth(null), offscreen.getHeight(null));
- // get logo position so its in the middle of applet
- int x = 0, y = 0;
-
- if(logo != null && !fatalError) {
- x = (offscreen.getWidth(null) - logo.getWidth(null)) / 2;
- y = (offscreen.getHeight(null) - logo.getHeight(null)) / 2;
- }
-
og.setColor(fgColor);
String message = getDescriptionForState();
@@ -464,12 +460,22 @@
painting = true;
+ // get logo position so its in the middle of applet
+ int x = 0, y = 0;
+
+ if(logo != null) {
+ x = (offscreen.getWidth(null) - logo.getWidth(null)) / 2;
+ y = (offscreen.getHeight(null) - logo.getHeight(null)) / 2;
+ }
+
// draw logo
- og.drawImage(logoBuffer, x, y, this);
+ if (logo != null) og.drawImage(logoBuffer, x, y, this);
// draw message
int messageX = (offscreen.getWidth(null) - fm.stringWidth(message)) / 2;
- int messageY = y + logoBuffer.getHeight(null) + 20;
+ int messageY = y + 20;
+ if (logo != null) messageY += logoBuffer.getHeight(null);
+
og.drawString(message, messageX, messageY);
// draw subtaskmessage, if any
@@ -479,9 +485,11 @@
}
// draw loading bar, clipping it depending on percentage done
- int barSize = (progressbarBuffer.getWidth(null) * percentage) / 100;
- og.clipRect(0, 0, x + barSize, offscreen.getHeight(null));
- og.drawImage(progressbarBuffer, x, y, this);
+ if (progressbar != null) {
+ int barSize = (progressbarBuffer.getWidth(null) * percentage) / 100;
+ og.clipRect(0, 0, x + barSize, offscreen.getHeight(null));
+ og.drawImage(progressbarBuffer, x, y, this);
+ }
painting = false;
}
@@ -519,7 +527,7 @@
g.fillRect(0, 0, buffer.getWidth(null), buffer.getHeight(null));
// buffer background is cleared, so draw logo under progressbar
- if (img == progressbar) g.drawImage(logoBuffer, 0, 0, null);
+ if (img == progressbar && logo != null) g.drawImage(logoBuffer, 0, 0, null);
g.drawImage(img, 0, 0, this);
g.dispose();
@@ -1438,7 +1446,10 @@
tracker.addImage(image, 0);
tracker.waitForAll();
- return image;
+ // if no errors return image
+ if (!tracker.isErrorAny()) {
+ return image;
+ }
} catch (Exception e) {
/* */
}
@@ -1572,5 +1583,4 @@
}
}
-
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-25 13:35:08
|
Revision: 3390
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3390&view=rev
Author: kappa1
Date: 2010-07-25 13:35:00 +0000 (Sun, 25 Jul 2010)
Log Message:
-----------
AppletLoader: removed dead code.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-25 13:31:49 UTC (rev 3389)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-25 13:35:00 UTC (rev 3390)
@@ -463,11 +463,6 @@
int x = offscreen.getWidth(null)/2;
int y = offscreen.getHeight(null)/2;
- /*if(logo != null) {
- x = (offscreen.getWidth(null) - logo.getWidth(null)) / 2;
- y = (offscreen.getHeight(null) - logo.getHeight(null)) / 2;
- }*/
-
// draw logo
if (logo != null) {
og.drawImage(logoBuffer, x-logo.getWidth(null)/2, y-logo.getHeight(null)/2, this);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-07-25 14:22:15
|
Revision: 3391
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3391&view=rev
Author: kappa1
Date: 2010-07-25 14:22:09 +0000 (Sun, 25 Jul 2010)
Log Message:
-----------
AppletLoader: slight tweak to make code more readable
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-25 13:35:00 UTC (rev 3390)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-07-25 14:22:09 UTC (rev 3391)
@@ -284,10 +284,10 @@
fgColor = getColor("boxfgcolor", Color.black);
// load logos, if value is "" then skip
- if (!getParameter("al_logo").equals("")) {
+ if (getParameter("al_logo").length() > 0) {
logo = getImage(getParameter("al_logo"));
}
- if (!getParameter("al_progressbar").equals("")) {
+ if (getParameter("al_progressbar").length() > 0) {
progressbar = getImage(getParameter("al_progressbar"));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-08-23 18:02:23
|
Revision: 3402
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3402&view=rev
Author: kappa1
Date: 2010-08-23 18:02:17 +0000 (Mon, 23 Aug 2010)
Log Message:
-----------
AppletLoader: fix mixed mode message when using custom logo images.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-16 22:18:33 UTC (rev 3401)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-23 18:02:17 UTC (rev 3402)
@@ -1434,7 +1434,7 @@
*/
protected Image getImage(String s) {
try {
- URL url = AppletLoader.class.getResource("/"+s);
+ URL url = ClassLoader.getSystemClassLoader().getResource("/"+s);
// if image not found in jar, look outside it
if (url == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-08-23 18:12:12
|
Revision: 3403
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3403&view=rev
Author: kappa1
Date: 2010-08-23 18:12:06 +0000 (Mon, 23 Aug 2010)
Log Message:
-----------
AppletLoader: slight tweak to use classloader the way Oracle recommend.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-23 18:02:17 UTC (rev 3402)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-23 18:12:06 UTC (rev 3403)
@@ -1434,7 +1434,7 @@
*/
protected Image getImage(String s) {
try {
- URL url = ClassLoader.getSystemClassLoader().getResource("/"+s);
+ URL url = Thread.currentThread().getContextClassLoader().getResource("/"+s);
// if image not found in jar, look outside it
if (url == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-08-28 12:05:01
|
Revision: 3404
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3404&view=rev
Author: kappa1
Date: 2010-08-28 12:04:55 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
AppletLoader: set java.library.path to the folder containing natives, this should make it easier when using extra custom native files.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-23 18:12:06 UTC (rev 3403)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-28 12:04:55 UTC (rev 3404)
@@ -892,6 +892,9 @@
// Make sure jinput knows about the new path too
System.setProperty("net.java.games.input.librarypath", path + "natives");
+ // set the library path, should make it easier when using additional custom natives
+ System.setProperty("java.library.path", path + "natives");
+
// mark natives as loaded
natives_loaded = true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-08-28 13:47:24
|
Revision: 3405
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3405&view=rev
Author: kappa1
Date: 2010-08-28 13:47:18 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
AppletLoader: slight tweak to the behaviour of al_version
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-28 12:04:55 UTC (rev 3404)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-08-28 13:47:18 UTC (rev 3405)
@@ -721,7 +721,7 @@
// if version file exists
if (versionFile.exists()) {
// compare to new version
- if (latestVersion <= readVersionFile(versionFile)) {
+ if (latestVersion != readVersionFile(versionFile)) {
versionAvailable = true;
percentage = 90;
@@ -892,7 +892,7 @@
// Make sure jinput knows about the new path too
System.setProperty("net.java.games.input.librarypath", path + "natives");
- // set the library path, should make it easier when using additional custom natives
+ // set the library path, useful for non lwjgl natives
System.setProperty("java.library.path", path + "natives");
// mark natives as loaded
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-10-07 20:33:07
|
Revision: 3432
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3432&view=rev
Author: kappa1
Date: 2010-10-07 20:33:01 +0000 (Thu, 07 Oct 2010)
Log Message:
-----------
AppletLoader: move cache directory to a better location, as the current location is periodically purged on mac and linux.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-10-04 22:51:19 UTC (rev 3431)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-10-07 20:33:01 UTC (rev 3432)
@@ -259,7 +259,7 @@
*/
public void init() {
state = STATE_INIT;
-
+
// sanity check
String[] requiredArgs = {"al_main", "al_logo", "al_progressbar", "al_jars"};
for ( String requiredArg : requiredArgs ) {
@@ -693,7 +693,7 @@
}
codebase += File.separator;
}
- return System.getProperty("java.io.tmpdir") + File.separator + codebase + getParameter("al_title") + File.separator;
+ return getCacheDir() + File.separator + codebase + getParameter("al_title") + File.separator;
}
});
@@ -775,6 +775,21 @@
loaderThread = null;
}
}
+
+ /**
+ * get path to the lwjgl cache directory
+ *
+ * @return path to the lwjgl cache directory
+ */
+ protected String getCacheDir() {
+ String cacheDir = System.getProperty("deployment.user.cachedir");
+
+ if (cacheDir == null) {
+ cacheDir = System.getProperty("java.io.tmpdir");
+ }
+
+ return cacheDir + File.separator + "lwjglcache";
+ }
/**
* read the current version file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2010-10-08 20:57:30
|
Revision: 3435
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3435&view=rev
Author: kappa1
Date: 2010-10-08 20:57:23 +0000 (Fri, 08 Oct 2010)
Log Message:
-----------
AppletLoader: use the tmp directory on Windows to store cache.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-10-08 20:19:44 UTC (rev 3434)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-10-08 20:57:23 UTC (rev 3435)
@@ -784,7 +784,7 @@
protected String getCacheDir() {
String cacheDir = System.getProperty("deployment.user.cachedir");
- if (cacheDir == null) {
+ if (cacheDir == null || System.getProperty("os.name").startsWith("Win")) {
cacheDir = System.getProperty("java.io.tmpdir");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-10 21:50:27
|
Revision: 3464
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3464&view=rev
Author: matzon
Date: 2011-01-10 21:50:21 +0000 (Mon, 10 Jan 2011)
Log Message:
-----------
add support for passing in lwjgl specific properties via java_arguments applet parameter
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-12-15 18:48:56 UTC (rev 3463)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-10 21:50:21 UTC (rev 3464)
@@ -759,6 +759,9 @@
// add the downloaded jars and natives to classpath
updateClassPath(path);
+
+ // set lwjgl properties
+ setLWJGLProperties();
// switch to LWJGL Applet
switchApplet();
@@ -777,6 +780,26 @@
}
/**
+ * Parses the java_arguments list and sets lwjgl specific
+ * properties accordingly, before the launch.
+ */
+ protected void setLWJGLProperties() {
+ String javaArguments = getParameter("java_arguments");
+ if(javaArguments != null && javaArguments.length() > 0) {
+ int start = javaArguments.indexOf("-Dorg.lwjgl");
+ while(start != -1) {
+ int end = javaArguments.indexOf(" ", start);
+ if(end == -1) {
+ end = javaArguments.length();
+ }
+ String[] keyValue = javaArguments.substring(start+2, end).split("=");
+ System.setProperty(keyValue[0], keyValue[1]);
+ start = javaArguments.indexOf("-Dorg.lwjgl", end);
+ }
+ }
+ }
+
+ /**
* get path to the lwjgl cache directory
*
* @return path to the lwjgl cache directory
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-01-11 20:54:33
|
Revision: 3465
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3465&view=rev
Author: matzon
Date: 2011-01-11 20:54:26 +0000 (Tue, 11 Jan 2011)
Log Message:
-----------
fixed issue with empty java_arguments by switching to lwjgl_arguments param name instead
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-10 21:50:21 UTC (rev 3464)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-11 20:54:26 UTC (rev 3465)
@@ -784,17 +784,21 @@
* properties accordingly, before the launch.
*/
protected void setLWJGLProperties() {
- String javaArguments = getParameter("java_arguments");
- if(javaArguments != null && javaArguments.length() > 0) {
- int start = javaArguments.indexOf("-Dorg.lwjgl");
+ String lwjglArguments = getParameter("lwjgl_arguments");
+
+ if(lwjglArguments != null && lwjglArguments.length() > 0) {
+ int start = lwjglArguments.indexOf("-Dorg.lwjgl");
while(start != -1) {
- int end = javaArguments.indexOf(" ", start);
+ int end = lwjglArguments.indexOf(" ", start);
if(end == -1) {
- end = javaArguments.length();
+ end = lwjglArguments.length();
}
- String[] keyValue = javaArguments.substring(start+2, end).split("=");
+ String[] keyValue = lwjglArguments.substring(start+2, end).split("=");
System.setProperty(keyValue[0], keyValue[1]);
- start = javaArguments.indexOf("-Dorg.lwjgl", end);
+ if(debugMode) {
+ System.out.println("Setting property " + keyValue[0] + " to " + keyValue[1]);
+ }
+ start = lwjglArguments.indexOf("-Dorg.lwjgl", end);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2011-01-12 20:01:19
|
Revision: 3466
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3466&view=rev
Author: kappa1
Date: 2011-01-12 20:01:12 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
Fixed null pointer exception in AppletLoader caused by cleaning up resources in the middle of a paint call. Thx to NateS for point this out and suggesting the fix.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-11 20:54:26 UTC (rev 3465)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-12 20:01:12 UTC (rev 3466)
@@ -230,7 +230,7 @@
protected String subtaskMessage = "";
/** state of applet loader */
- protected int state = STATE_INIT;
+ protected volatile int state = STATE_INIT;
/** whether lzma is supported */
protected boolean lzmaSupported;
@@ -406,6 +406,7 @@
public void paint(Graphics g) {
// don't paint loader if applet loaded
if(state == STATE_DONE) {
+ cleanUp(); // clean up resources
return;
}
@@ -767,8 +768,6 @@
switchApplet();
state = STATE_DONE;
- // clean up resources
- cleanUp();
} catch (AccessControlException ace) {
fatalErrorOccured(ace.getMessage(), ace);
certificateRefused = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2011-01-12 20:18:44
|
Revision: 3467
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3467&view=rev
Author: kappa1
Date: 2011-01-12 20:18:38 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
AppletLoader fix, allow non lwjgl natives to be found in the cache directory. Again thx to NateS for finding and providing a fix.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-12 20:01:12 UTC (rev 3466)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-12 20:18:38 UTC (rev 3467)
@@ -921,6 +921,11 @@
return perms;
}
+
+ // allow non lwjgl native to be found from cache directory
+ protected String findLibrary (String libname) {
+ return path + "natives" + File.separator + System.mapLibraryName(libname);
+ }
};
debug_sleep(2000);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2011-01-12 20:29:13
|
Revision: 3468
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3468&view=rev
Author: kappa1
Date: 2011-01-12 20:29:06 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
add missing final
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-12 20:18:38 UTC (rev 3467)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-12 20:29:06 UTC (rev 3468)
@@ -880,7 +880,7 @@
* @param path location where applet is stored
* @throws Exception if it fails to add classpath
*/
- protected void updateClassPath(String path) throws Exception {
+ protected void updateClassPath(final String path) throws Exception {
state = STATE_UPDATING_CLASSPATH;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2011-01-13 10:54:10
|
Revision: 3469
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3469&view=rev
Author: kappa1
Date: 2011-01-13 10:54:04 +0000 (Thu, 13 Jan 2011)
Log Message:
-----------
AppletLoader - Fix a threading issue where the cleanUp() method could fail to be called.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-12 20:29:06 UTC (rev 3468)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-13 10:54:04 UTC (rev 3469)
@@ -768,6 +768,7 @@
switchApplet();
state = STATE_DONE;
+ repaint();
} catch (AccessControlException ace) {
fatalErrorOccured(ace.getMessage(), ace);
certificateRefused = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2011-01-22 13:26:13
|
Revision: 3473
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3473&view=rev
Author: kappa1
Date: 2011-01-22 13:26:07 +0000 (Sat, 22 Jan 2011)
Log Message:
-----------
AppletLoader: make debug mode a little more useful to debug issues with, it'll output the AppletLoader state to the java console.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-19 21:25:32 UTC (rev 3472)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-22 13:26:07 UTC (rev 3473)
@@ -258,7 +258,7 @@
* @see java.applet.Applet#init()
*/
public void init() {
- state = STATE_INIT;
+ setState(STATE_INIT);
// sanity check
String[] requiredArgs = {"al_main", "al_logo", "al_progressbar", "al_jars"};
@@ -593,7 +593,7 @@
* jar to the urlList
*/
protected void loadJarURLs() throws Exception {
- state = STATE_DETERMINING_PACKAGES;
+ setState(STATE_DETERMINING_PACKAGES);
// jars to load
String jarList = getParameter("al_jars");
@@ -671,7 +671,7 @@
* 5) switch applets
*/
public void run() {
- state = STATE_CHECKING_CACHE;
+ setState(STATE_CHECKING_CACHE);
percentage = 5;
@@ -767,7 +767,7 @@
// switch to LWJGL Applet
switchApplet();
- state = STATE_DONE;
+ setState(STATE_DONE);
repaint();
} catch (AccessControlException ace) {
fatalErrorOccured(ace.getMessage(), ace);
@@ -883,7 +883,7 @@
*/
protected void updateClassPath(final String path) throws Exception {
- state = STATE_UPDATING_CLASSPATH;
+ setState(STATE_UPDATING_CLASSPATH);
percentage = 95;
@@ -1001,7 +1001,7 @@
*/
protected void switchApplet() throws Exception {
- state = STATE_SWITCHING_APPLET;
+ setState(STATE_SWITCHING_APPLET);
percentage = 100;
debug_sleep(2000);
@@ -1016,10 +1016,10 @@
add(lwjglApplet);
validate();
- state = STATE_INITIALIZE_REAL_APPLET;
+ setState(STATE_INITIALIZE_REAL_APPLET);
lwjglApplet.init();
- state = STATE_START_REAL_APPLET;
+ setState(STATE_START_REAL_APPLET);
lwjglApplet.start();
}
@@ -1094,7 +1094,7 @@
*/
protected void downloadJars(String path) throws Exception {
- state = STATE_DOWNLOADING;
+ setState(STATE_DOWNLOADING);
URLConnection urlconnection;
@@ -1305,7 +1305,7 @@
* @throws Exception if any errors occur
*/
protected void extractJars(String path) throws Exception {
- state = STATE_EXTRACTING_PACKAGES;
+ setState(STATE_EXTRACTING_PACKAGES);
float increment = (float) 10.0 / urlList.length;
// extract all lzma and pack.lzma files
@@ -1354,7 +1354,7 @@
return;
}
- state = STATE_EXTRACTING_PACKAGES;
+ setState(STATE_EXTRACTING_PACKAGES);
int initialPercentage = percentage;
@@ -1616,6 +1616,17 @@
repaint();
}
+ /**
+ * set the state of applet loader
+ * @param new state of applet loader
+ * */
+ protected void setState(int state) {
+ this.state = state;
+ if(debugMode) {
+ System.out.println(getDescriptionForState());
+ }
+ }
+
/**
* Utility method for sleeping
* Will only really sleep if debug has been enabled
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|