You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
|
|
3
|
4
|
5
(5) |
6
(1) |
7
|
8
|
9
|
|
10
(2) |
11
(1) |
12
|
13
|
14
|
15
|
16
(7) |
|
17
|
18
|
19
(1) |
20
(1) |
21
(2) |
22
(1) |
23
|
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
|
31
|
|
|
|
|
|
|
|
From: Kevin G. <kev...@us...> - 2005-07-16 11:28:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4720/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Fix for alpha based icons under win32. Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- org_lwjgl_opengl_Display.c 16 Jul 2005 10:30:16 -0000 1.27 +++ org_lwjgl_opengl_Display.c 16 Jul 2005 11:27:58 -0000 1.28 @@ -446,9 +446,19 @@ for (y = 0; y < height; y++ ) { dstPtr = ptrCursorImage + wordAlignedWidth*y;; for (x = 0; x < width; x++ ) { - dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF; - dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF; - dstPtr[2] = pixels[y*width+x] & 0xFF; + if ((pixels[y*width+x] & 0xFF000000) != 0) + { + dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF; + dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF; + dstPtr[2] = pixels[y*width+x] & 0xFF; + } + else + { + dstPtr[0] = 0; + dstPtr[1] = 0; + dstPtr[2] = 0; + } + dstPtr += 3; } } @@ -482,7 +492,7 @@ mask = 0; maskPixelsOff = scanlineWidth*y; for (x = 0; x < width; x++) { - col = (((pixels[width*y+x] & 0xFF000000) != 0) ? 1 : 0) << leftShift; + col = (((pixels[(width*y)+x] & 0xFF000000) != 0) ? 1 : 0) << leftShift; mask = mask | col; leftShift--; if (leftShift == -1) { |
|
From: Brian M. <ma...@us...> - 2005-07-16 11:15:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2921/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: caching of window icon Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- Display.java 5 Jul 2005 21:54:12 -0000 1.54 +++ Display.java 16 Jul 2005 11:15:37 -0000 1.55 @@ -75,6 +75,9 @@ /** X coordinate of the window */ private static int x = -1; + + /** Cached window icons, for when Display is recreated */ + private static ByteBuffer[] cached_icons; /** * Y coordinate of the window. Y in window coordinates is from the top of the display down, @@ -266,6 +269,11 @@ initControls(); setVSyncEnabled(vsync); window_created = true; + + // set cached window icon if exists + if(cached_icons != null) { + setIcon(cached_icons); + } } private static void destroyWindow() { @@ -725,6 +733,7 @@ destroyWindow(); destroyContext(); x = y = -1; + cached_icons = null; reset(); } @@ -824,11 +833,28 @@ * <li>Mac OS X should be supplied one 128x128 icon</li> * </ul> * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform. + * <p> + * <b>NOTE:</b> The display will make a deep copy of the supplied byte buffer array, for the purpose + * of recreating the icons when you go back and forth fullscreen mode. You therefore only need to + * set the icon once per instance. * * @param icons Array of icons in RGBA mode - * @return number of icons used. + * @return number of icons used, or 0 if display hasn't been created */ public static int setIcon(ByteBuffer[] icons) { - return display_impl.setIcon(icons); + + // make deep copy so we dont rely on the supplied buffers later on + cached_icons = new ByteBuffer[icons.length]; + for(int i=0;i<icons.length; i++) { + cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity()); + cached_icons[i].put(icons[i]); + cached_icons[i].flip(); + } + + if(Display.isCreated()) { + return display_impl.setIcon(cached_icons); + } else { + return 0; + } } } |
|
From: Kevin G. <kev...@us...> - 2005-07-16 10:37:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29907/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: LWJGL icon used as window icon in test. Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- WindowCreationTest.java 11 Jul 2005 17:05:11 -0000 1.34 +++ WindowCreationTest.java 16 Jul 2005 10:37:00 -0000 1.35 @@ -31,7 +31,9 @@ */ package org.lwjgl.test; +import java.io.File; import java.nio.ByteBuffer; +import java.io.IOException; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; @@ -39,6 +41,7 @@ import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; +import org.lwjgl.util.XPMFile; /** * Small class for testing that the Window is creatable @@ -94,28 +97,41 @@ window_x = window_y = 100; Display.setLocation(window_x, window_y); - // Icon test + File file = new File(new File("res"), "lwjgl_16x16.xpm"); ByteBuffer size16 = BufferUtils.createByteBuffer(16 * 16 * 4); - for(int i=0; i<16; i++) { - for(int j=0; j<16; j++) { - size16.putInt(0xffffffff); - } - } + XPMFile xpm = XPMFile.load(file.getAbsolutePath()); + size16.put(xpm.getBytes()); size16.flip(); + // Icon test +// for(int i=0; i<16; i++) { +// for(int j=0; j<16; j++) { +// size16.putInt(0xffffffff); +// } +// } +// size16.flip(); + + file = new File(new File("res"), "lwjgl_32x32.xpm"); ByteBuffer size32 = BufferUtils.createByteBuffer(32 * 32 * 4); - for(int i=0; i<32; i++) { - for(int j=0; j<32; j++) { - size32.putInt(0xff0000ff); - } - } + xpm = XPMFile.load(file.getAbsolutePath()); + size32.put(xpm.getBytes()); size32.flip(); +// ByteBuffer size32 = BufferUtils.createByteBuffer(32 * 32 * 4); +// for(int i=0; i<32; i++) { +// for(int j=0; j<32; j++) { +// size32.putInt(0xff0000ff); +// } +// } +// size32.flip(); + Display.create(); Display.setIcon(new ByteBuffer[] { size16, size32 }); return true; } catch (LWJGLException le) { le.printStackTrace(); + } catch (IOException ioe) { + ioe.printStackTrace(); } return false; } |
|
From: Kevin G. <kev...@us...> - 2005-07-16 10:36:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29800/src/java/org/lwjgl/util Modified Files: XPMFile.java Log Message: Fix for compilation on 1.4, remove autoboxing Index: XPMFile.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/XPMFile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XPMFile.java 16 Jul 2005 09:11:26 -0000 1.1 +++ XPMFile.java 16 Jul 2005 10:36:13 -0000 1.2 @@ -144,7 +144,7 @@ String color = line.substring(6); // we always assume type is color, and supplied as #<r><g><b> - return new Object[] { key, Integer.parseInt(color, 16)}; + return new Object[] { key, new Integer(Integer.parseInt(color, 16))}; } /** |
|
From: Kevin G. <kev...@us...> - 2005-07-16 10:30:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28886/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Fix win32 icon alpha mask Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_opengl_Display.c 10 Jul 2005 20:16:53 -0000 1.26 +++ org_lwjgl_opengl_Display.c 16 Jul 2005 10:30:16 -0000 1.27 @@ -476,12 +476,13 @@ imageSize = scanlineWidth*height; maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize); memset(maskPixels, 0, imageSize); + for (y = 0; y < height; y++) { leftShift = 7; mask = 0; maskPixelsOff = scanlineWidth*y; for (x = 0; x < width; x++) { - col = (pixels[width*y+x] & 0x00000001) << leftShift; + col = (((pixels[width*y+x] & 0xFF000000) != 0) ? 1 : 0) << leftShift; mask = mask | col; leftShift--; if (leftShift == -1) { @@ -490,12 +491,12 @@ mask = 0; } } - // write what is left over if (leftShift != 7) { maskPixels[maskPixelsOff++] = ~mask; } } + cursorMask = CreateBitmap(width, height, 1, 1, maskPixels); memset(&iconInfo, 0, sizeof(ICONINFO)); |
|
From: Brian M. <ma...@us...> - 2005-07-16 09:13:37
|
Update of /cvsroot/java-game-lib/LWJGL/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17567/res Added Files: lwjgl_16x16.xpm lwjgl_32x32.xpm Log Message: temp XPM logo files --- NEW FILE: lwjgl_32x32.xpm --- /* XPM */ static char * lwjgl_32x32_xpm[] = { "32 32 240 2", " c #FFFFFF", ". c #FAFCFD", "+ c #CBDDEC", "@ c #93B7D6", "# c #6FA0C9", "$ c #5C93C2", "% c #6096C3", "& c #7AA7CD", "* c #ACC8E0", "= c #EDF3F8", "- c #FCFDFE", "; c #B5CEE3", "> c #5A92C1", ", c #3A7DB5", "' c #4585B9", ") c #A1C1DC", "! c #FCFCFC", "~ c #E2EAF1", "{ c #B8CFE3", "] c #AEC9E0", "^ c #A3C2DC", "/ c #98BAD8", "( c #8CB3D3", "_ c #81ACCF", ": c #6E9FC8", "< c #3D7FB6", "[ c #72A2CA", "} c #F5F8FB", "| c #D8D8D8", "1 c #313131", "2 c #242424", "3 c #404040", "4 c #525252", "5 c #656565", "6 c #747474", "7 c #8F8F8F", "8 c #F7F8F8", "9 c #ACC8DF", "0 c #3B7DB5", "a c #79A7CD", "b c #FEFEFE", "c c #686868", "d c #000000", "e c #B6B6B6", "f c #86AED1", "g c #AECAE1", "h c #D3E2EE", "i c #E1EAF2", "j c #282828", "k c #020202", "l c #DEDEDE", "m c #5B92C1", "n c #4886BA", "o c #F4F8FB", "p c #ECF3F8", "q c #6499C5", "r c #D7D9DB", "s c #050505", "t c #C0D5E7", "u c #397CB5", "v c #ABC8E0", "w c #FEFFFF", "x c #78A6CC", "y c #7BA7CD", "z c #9E9E9E", "A c #E2ECF4", "B c #377BB4", "C c #669AC5", "D c #C3D7E8", "E c #397DB5", "F c #B2CCE1", "G c #585858", "H c #A9A9A9", "I c #BCD2E5", "J c #4081B7", "K c #EEF4F9", "L c #DDE5ED", "M c #1C1C1C", "N c #070707", "O c #E7E7E7", "P c #85AED1", "Q c #CCDEEC", "R c #BAD2E5", "S c #5790BF", "T c #D0D1D1", "U c #030303", "V c #333333", "W c #FDFDFD", "X c #FBFCFD", "Y c #508BBD", "Z c #B1CCE2", "` c #CACACA", " . c #373737", ".. c #616161", "+. c #A2A2A2", "@. c #DDDDDD", "#. c #E4ECF3", "$. c #B1CBE1", "%. c #B4CDE2", "&. c #E6E6E6", "*. c #232323", "=. c #727272", "-. c #D8E5F0", ";. c #A0C0DB", ">. c #666666", ",. c #060606", "'. c #272727", "). c #D4D4D4", "!. c #F6F6F6", "~. c #D0D0D0", "{. c #979797", "]. c #5E5E5E", "^. c #040404", "/. c #C0C0C0", "(. c #A2C1DB", "_. c #9EBFDA", ":. c #FBFBFB", "<. c #252525", "[. c #5C5C5C", "}. c #EAEAEA", "|. c #B5B5B5", "1. c #E9E9E9", "2. c #B2B2B2", "3. c #BDBDBD", "4. c #6B9DC7", "5. c #DBDBDB", "6. c #838383", "7. c #5F5F5F", "8. c #0B0B0B", "9. c #767676", "0. c #B7B7B7", "a. c #F0F0F0", "b. c #F0F5F9", "c. c #4B88BB", "d. c #B2CCE2", "e. c #9A9A9A", "f. c #C5C5C5", "g. c #F7F7F7", "h. c #1D1D1D", "i. c #3C3C3C", "j. c #DFDFDF", "k. c #F3F7FA", "l. c #CCDDEB", "m. c #9EBEDA", "n. c #72A1C9", "o. c #4C89BB", "p. c #C9DCEB", "q. c #565656", "r. c #0F0F0F", "s. c #F9F9F9", "t. c #D1D1D1", "u. c #8E8E8E", "v. c #848484", "w. c #707070", "x. c #B0B0B0", "y. c #F9FBFC", "z. c #DCE8F2", "A. c #F6F9FC", "B. c #151515", "C. c #4E4E4E", "D. c #919191", "E. c #BBBBBB", "F. c #2F2F2F", "G. c #393939", "H. c #909090", "I. c #4D4D4D", "J. c #101010", "K. c #5A5A5A", "L. c #090909", "M. c #323232", "N. c #B1B1B1", "O. c #A1A1A1", "P. c #353535", "Q. c #F5F5F5", "R. c #131313", "S. c #454545", "T. c #F8F8F8", "U. c #2B2B2B", "V. c #BEBEBE", "W. c #505050", "X. c #C2C2C2", "Y. c #868686", "Z. c #D2D2D2", "`. c #010101", " + c #434343", ".+ c #DCDCDC", "++ c #E0E0E0", "@+ c #959595", "#+ c #C8C8C8", "$+ c #888888", "%+ c #292929", "&+ c #181818", "*+ c #4A4A4A", "=+ c #CFCFCF", "-+ c #F1F6FA", ";+ c #4B4B4B", ">+ c #86AFD1", ",+ c #90B5D5", "'+ c #EAF1F7", ")+ c #787878", "!+ c #1B1B1B", "~+ c #969696", "{+ c #C6C6C6", "]+ c #C3D8E9", "^+ c #4383B8", "/+ c #94B8D6", "(+ c #F4F4F4", "_+ c #A7A7A7", ":+ c #858585", "<+ c #9D9D9D", "[+ c #FAFBFD", "}+ c #5D94C2", "|+ c #4685B9", "1+ c #98BBD8", "2+ c #EFF4F9", "3+ c #9B9B9B", "4+ c #C5D9E9", "5+ c #3B7EB6", "6+ c #F2F6FA", "7+ c #2C2C2C", "8+ c #8FB5D5", "9+ c #4A87BB", "0+ c #FAFAFA", "a+ c #6E6E6E", "b+ c #85AFD1", "c+ c #4D89BC", "d+ c #A8C5DE", "e+ c #0E0E0E", "f+ c #B8B8B8", "g+ c #FEFEFF", "h+ c #B1CBE2", "i+ c #4C89BC", "j+ c #BFD4E7", "k+ c #ECECEC", "l+ c #939393", "m+ c #81ACD0", "n+ c #6599C5", "o+ c #6197C4", "p+ c #6C9EC8", "q+ c #F7FAFC", " . + @ # $ % & * = ", " - ; > , , , , , , , ' ) - ", " ! ~ { ] ^ / ( _ : < , , , [ } ", " | 1 2 1 3 4 5 6 7 8 9 0 , , , a - ", " b c d d d d d d d d e b f , , , , g ", " h i j d d d d d d d k l } m , , , n o ", " p q r s d d d d d d d 2 b t u , , , v ", " w x y z d d d d d d d d 5 A B , , , C ", " D E F G d d d d d d d d H I , , , , J K ", " . > < L M d d d d d d d N O P , , , , E Q ", " b R , S T U d d d d d d d V W X Y , , , , E Z ", " ` ...+.@.#.$.%.&.*.d d d d d d d =. -., , , , , , ;. ", " >.d d d ,.'.>.). !.~.{.].'.^.d U /. (., , , , , , _. ", ":.<.d d d d d d [. }.7 |.1.W O 2.3.b 4., , , , , , ) ", "5.U d d d d d d 6. 7.d d 8. .9.0.a. b.c.< u , , , , d. ", "e.d d d d d d d f.g.h.d d d d d d N i.j. X - k.l.m.n.o., p. ", "q.d d d d d d r.s.t.U d d d d d d d d u. s.v.w.x.}. y.z.A. ", "B.d d d d d d C. D.d d d d d d d d d E. z d d d ^.F.w.x.&.b ", "G.d d d d d d H. I.d d d d d d d d J.a. K.d d d d d d d L.M.N.", "!.O.P.k d d k t.Q.R.d d d d d d d d S.b T.h.d d d d d d d d d U.", " ! V.W.s <.s.X.d d d d d d d d d Y. Z.`.d d d d d d d d d +", " b .+++ @+d d d d d d d d `.#+ u.d d d d d d d d d d $+", " j.%+d d d d d d d &+Q. *+d d d d d d d d d d =+", " -+ s.|.;+,.d d d d 4 T.J.d d d d d d d d d M T.", " >+,+'+ 5.)+!+d d ~+ {+d d d d d d d d d d K. ", " ]+, ^+/+= (+_+:+(+ Y.d d d d d d d d d d <+ ", " [+}+, , |+1+2+ 3+d d d d d d d d d s @. ", " 4+5+, , , n m.6+ :.u.<.`.d d d d d d 7+! ", " 8+, , , , , 9+^ k. 0+x.S.^.d d d d a+ ", " - b+, , , , , , c+d+A. b Z.c e+d `.f+ ", " g+h+i+E , , , , , c+j+ k+l+3+W ", " k.; m+n+o+p+8+4+q+ "}; --- NEW FILE: lwjgl_16x16.xpm --- /* XPM */ static char * lwjgl_logo_2a_xpm[] = { "16 16 122 2", " c #000000", ". c #010101", "+ c #020202", "@ c #030303", "# c #0A0A0A", "$ c #0C0C0C", "% c #0E0E0E", "& c #171717", "* c #1B1B1B", "= c #1D1D1D", "- c #1F1F1F", "; c #222222", "> c #232323", ", c #2B2B2B", "' c #2D2D2D", ") c #333333", "! c #3D3D3D", "~ c #404040", "{ c #434343", "] c #4A4A4A", "^ c #4F4F4F", "/ c #525252", "( c #565656", "_ c #585858", ": c #595959", "< c #5C5C5C", "[ c #5E5E5E", "} c #5F5F5F", "| c #666666", "1 c #686868", "2 c #6C6C6C", "3 c #6D6D6D", "4 c #397CB5", "5 c #3A7DB5", "6 c #3D7FB6", "7 c #3E80B6", "8 c #747474", "9 c #787878", "0 c #4886BA", "a c #4C89BC", "b c #4D89BC", "c c #508BBD", "d c #508CBD", "e c #76828D", "f c #548EBF", "g c #5690C0", "h c #848484", "i c #5B92C1", "j c #7D8D9B", "k c #6096C3", "l c #8C8C8C", "m c #8D8F91", "n c #669AC5", "o c #919191", "p c #6D9EC8", "q c #8499AA", "r c #959595", "s c #71A1CA", "t c #74A4CB", "u c #9B9B9B", "v c #77A5CC", "w c #9C9EA0", "x c #7CA8CE", "y c #7EA9CE", "z c #A1A1A1", "A c #81ABCE", "B c #82ACD0", "C c #84ADD0", "D c #A5A5A5", "E c #A6A6A7", "F c #86AFD2", "G c #87B0D2", "H c #A8A8A8", "I c #8CB3D4", "J c #8DB4D4", "K c #91B6D5", "L c #94B7D5", "M c #97BAD8", "N c #9EBFDA", "O c #A2C1DC", "P c #BCBCBC", "Q c #BDBDBD", "R c #BFBFBF", "S c #C0C0C0", "T c #B0C5D6", "U c #C6C6C6", "V c #CCCCCC", "W c #CFCFCF", "X c #D0D0D0", "Y c #C2D7E8", "Z c #D3D3D3", "` c #C4D8E9", " . c #D4D4D4", ".. c #C6D9E9", "+. c #D6D6D6", "@. c #D0E0ED", "#. c #DADEE1", "$. c #D2E1EE", "%. c #DFDFDF", "&. c #E4E4E4", "*. c #DAE7F1", "=. c #E5E5E5", "-. c #E6E6E6", ";. c #E0EAF3", ">. c #E2ECF4", ",. c #E4EDF5", "'. c #E7EFF6", "). c #EEEEEE", "!. c #E8F0F6", "~. c #EFEFEF", "{. c #EBF2F8", "]. c #EDF3F8", "^. c #F2F2F2", "/. c #F5F5F5", "(. c #F6F6F6", "_. c #F4F8FB", ":. c #FBFBFB", "<. c #FAFCFD", "[. c #FCFDFE", "}. c #FEFEFE", "|. c #FEFFFF", "1. c #FFFFFF", "1.1.1.1.1.1.|.Y t c f F '.1.1.1.", "1.1.1.1.1./.m e j q L 5 0 *.1.1.", "1.1.1.1._.w &.C 5 i [.1.", "1.1.1.1.K } ; 1.!.4 5 ` 1.", "1.1.1...A = | 1.@.5 5 J 1.", "^.D %.O T # H 1.M 5 5 s 1.", "z . > V X D h < ~.1.k 5 5 p 1.", "[ W - @ , 2 U <.N v a x 1.", "* & +.. / =.! 1 E #.1.", "8 % : r o u + { ", "1.).l R ( Z _ ) ", "1.1.[.1.S ~ + * :.& 9 ", "1.1.$.y ;.1. .3 h Z Q ", "1.1.}.n 6 B ,.1.1.=.' $ (.", "1.1.1.>.b 5 7 G '.1.}.P ^ @ ] 1.", "1.1.1.1.{.I g d v ].1.1.1.%.-.1."}; |
|
From: Brian M. <ma...@us...> - 2005-07-16 09:11:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17296/src/java/org/lwjgl/util Added Files: XPMFile.java Log Message: XPM File reader --- NEW FILE: XPMFile.java --- package org.lwjgl.util; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.StringTokenizer; /** * $Id$ * <p> * NOTE: This simple XPM reader does not support extensions nor hotspots * </p> * @author Brian Matzon <br...@ma...> * @version $Revision$ */ public class XPMFile { /** Array of bytes (RGBA) */ private byte bytes[] = null; /** Height of image */ private int height = 0; /** Width of image */ private int width = 0; /* * Private constructor, use load(String filename) */ private XPMFile() { } /** * Loads the XPM file * * @param file path to file * @return XPMFile loaded, or exception * @throws FileNotFoundException If file isn't found * @throws IOException If any IO exceptions occurs while reading file */ public static XPMFile load(String file) throws FileNotFoundException, IOException { XPMFile xFile = new XPMFile(); xFile.readImage(file); return xFile; } /** * @return the height of the image. */ public int getHeight() { return height; } /** * @return the width of the image. */ public int getWidth() { return width; } /** * @return The data of the image. */ public byte[] getBytes() { return bytes; } /** * Read the image from the specified file. * * @throws FileNotFoundException If file isn't found * @throws IOException If any IO exceptions occurs while reading file */ private void readImage(String filename) throws FileNotFoundException, IOException { try { BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filename)))); HashMap colors = new HashMap(); String comment = br.readLine(); String typedef = br.readLine(); int[] format = parseFormat(br.readLine()); // setup color mapping for (int i = 0; i < format[2]; i++) { Object[] colorDefinition = parseColor(br.readLine()); colors.put(colorDefinition[0], colorDefinition[1]); } // read actual image (convert to RGBA) bytes = new byte[format[0] * format[1] * 4]; for (int i = 0; i < format[1]; i++) { parseImageLine(br.readLine(), format, colors, i); } } catch (Exception e) { throw new IllegalArgumentException("Unable to parse XPM File"); } } /** * Parses the format of the xpm file given a format string * * @param format String to parse * @return Array specifying width, height, colors, characters per pixel */ private int[] parseFormat(String format) { // format should look like this: // "16 16 122 2", // nuke first and last " and last , format = format.substring(1, format.length() - 2); // tokenize it StringTokenizer st = new StringTokenizer(format); return new int[] { Integer.parseInt(st.nextToken()), /* width */ Integer.parseInt(st.nextToken()), /* height */ Integer.parseInt(st.nextToken()), /* colors */ Integer.parseInt(st.nextToken()) /* chars per pixel */ }; } /** * Given a line defining a color/pixel, parses this into an array containing * a key and a color * @param line Line to parse * @return Array containing a key (String) and a color (Integer) */ private Object[] parseColor(String line) { // line should look like this // "# c #0A0A0A", // nuke first and last " line = line.substring(1, line.length() - 2); String key = line.substring(0, 2); String type = line.substring(3, 4); String color = line.substring(6); // we always assume type is color, and supplied as #<r><g><b> return new Object[] { key, Integer.parseInt(color, 16)}; } /** * Parses an Image line into its byte values * @param line Line of chars to parse * @param format Format to expext it in * @param colors Colors to lookup * @param index current index into lines, we've reached */ private void parseImageLine(String line, int[] format, HashMap colors, int index) { // offset for next line int offset = index * 4 * format[0]; // nuke first " line = line.substring(1, line.length()); // read format[3] characters format[0] times, each iteration is one color for (int i = 0; i < format[0]; i++) { String key = line.substring(i * 2, (i * 2 + 2)); Integer color = (Integer) colors.get(key); bytes[offset + (i * 4) ] = (byte) ((color.intValue() & 0x00ff0000) >> 16); bytes[offset + ((i * 4) + 1)] = (byte) ((color.intValue() & 0x0000ff00) >> 8); bytes[offset + ((i * 4) + 2)] = (byte) ((color.intValue() & 0x000000ff) >> 0); // looks better :) bytes[offset + ((i * 4) + 3)] = (byte) 0xff; // always 0xff alpha } } /** * @param args */ public static void main(String[] args) { if (args.length != 1) { System.out.println("usage:\nXPMFile <file>"); } try { String out = args[0].substring(0, args[0].indexOf(".")) + ".raw"; XPMFile file = XPMFile.load(args[0]); BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(out))); bos.write(file.getBytes()); bos.close(); //showResult(file.getBytes()); } catch (Exception e) { e.printStackTrace(); } } /* private static void showResult(byte[] bytes) { final BufferedImage i = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); int c = 0; for (int y = 0; y < 16; y++) { for (int x = 0; x < 16; x++) { i.setRGB(x, y, (bytes[c] << 16) + (bytes[c + 1] << 8) + (bytes[c + 2] << 0) + (bytes[c + 3] << 24));//+(128<<24));// c += 4; } } final Frame frame = new Frame("XPM Result"); frame.add(new Canvas() { public void paint(Graphics g) { g.drawImage(i, 0, 0, frame); } }); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { frame.dispose(); } }); frame.setSize(100, 100); frame.setVisible(true); }*/ } |