diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-02-08 20:35:06 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-02-08 20:35:06 -0500 |
commit | 68b547a9de60342bb79e0223504ad115bcef90b0 (patch) | |
tree | c6daad36a7aeaea392fdf1b7c2ffc1accb4e5b70 /src/com | |
parent | 3cecb76e6a2240f052eb14a374b7a75950cbbc3d (diff) | |
download | fourpuzzle-68b547a9de60342bb79e0223504ad115bcef90b0.tar.gz fourpuzzle-68b547a9de60342bb79e0223504ad115bcef90b0.tar.bz2 fourpuzzle-68b547a9de60342bb79e0223504ad115bcef90b0.zip |
Added an RTP
Diffstat (limited to 'src/com')
-rwxr-xr-x | src/com/fourisland/fourpuzzle/Database.java | 2 | ||||
-rw-r--r-- | src/com/fourisland/fourpuzzle/resources/chipset/Basis.png | bin | 0 -> 34612 bytes | |||
-rw-r--r-- | src/com/fourisland/fourpuzzle/resources/music/GameOver.mid | bin | 0 -> 6859 bytes | |||
-rwxr-xr-x | src/com/fourisland/fourpuzzle/resources/music/Opening1.mid | bin | 0 -> 48328 bytes | |||
-rw-r--r-- | src/com/fourisland/fourpuzzle/resources/picture/GameOver.png | bin | 0 -> 27367 bytes | |||
-rw-r--r-- | src/com/fourisland/fourpuzzle/resources/picture/System.png | bin | 0 -> 2075 bytes | |||
-rw-r--r-- | src/com/fourisland/fourpuzzle/resources/picture/Title.png | bin | 0 -> 16801 bytes | |||
-rw-r--r-- | src/com/fourisland/fourpuzzle/resources/sound/Cursor1.wav | bin | 0 -> 678 bytes | |||
-rwxr-xr-x | src/com/fourisland/fourpuzzle/util/ObjectLoader.java | 49 |
9 files changed, 27 insertions, 24 deletions
diff --git a/src/com/fourisland/fourpuzzle/Database.java b/src/com/fourisland/fourpuzzle/Database.java index b6e97cf..30bc8a3 100755 --- a/src/com/fourisland/fourpuzzle/Database.java +++ b/src/com/fourisland/fourpuzzle/Database.java | |||
@@ -66,7 +66,7 @@ public class Database { | |||
66 | 66 | ||
67 | public static void loadDefaultMusic() | 67 | public static void loadDefaultMusic() |
68 | { | 68 | { |
69 | music.put("Title", "Opening"); | 69 | music.put("Title", "Opening1"); |
70 | music.put("GameOver", "GameOver"); | 70 | music.put("GameOver", "GameOver"); |
71 | } | 71 | } |
72 | 72 | ||
diff --git a/src/com/fourisland/fourpuzzle/resources/chipset/Basis.png b/src/com/fourisland/fourpuzzle/resources/chipset/Basis.png new file mode 100644 index 0000000..7e71444 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/resources/chipset/Basis.png | |||
Binary files differ | |||
diff --git a/src/com/fourisland/fourpuzzle/resources/music/GameOver.mid b/src/com/fourisland/fourpuzzle/resources/music/GameOver.mid new file mode 100644 index 0000000..8e17673 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/resources/music/GameOver.mid | |||
Binary files differ | |||
diff --git a/src/com/fourisland/fourpuzzle/resources/music/Opening1.mid b/src/com/fourisland/fourpuzzle/resources/music/Opening1.mid new file mode 100755 index 0000000..c723287 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/resources/music/Opening1.mid | |||
Binary files differ | |||
diff --git a/src/com/fourisland/fourpuzzle/resources/picture/GameOver.png b/src/com/fourisland/fourpuzzle/resources/picture/GameOver.png new file mode 100644 index 0000000..8c5d3de --- /dev/null +++ b/src/com/fourisland/fourpuzzle/resources/picture/GameOver.png | |||
Binary files differ | |||
diff --git a/src/com/fourisland/fourpuzzle/resources/picture/System.png b/src/com/fourisland/fourpuzzle/resources/picture/System.png new file mode 100644 index 0000000..d953dd2 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/resources/picture/System.png | |||
Binary files differ | |||
diff --git a/src/com/fourisland/fourpuzzle/resources/picture/Title.png b/src/com/fourisland/fourpuzzle/resources/picture/Title.png new file mode 100644 index 0000000..850ad8d --- /dev/null +++ b/src/com/fourisland/fourpuzzle/resources/picture/Title.png | |||
Binary files differ | |||
diff --git a/src/com/fourisland/fourpuzzle/resources/sound/Cursor1.wav b/src/com/fourisland/fourpuzzle/resources/sound/Cursor1.wav new file mode 100644 index 0000000..c8d4169 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/resources/sound/Cursor1.wav | |||
Binary files differ | |||
diff --git a/src/com/fourisland/fourpuzzle/util/ObjectLoader.java b/src/com/fourisland/fourpuzzle/util/ObjectLoader.java index 7f7128f..2000a1c 100755 --- a/src/com/fourisland/fourpuzzle/util/ObjectLoader.java +++ b/src/com/fourisland/fourpuzzle/util/ObjectLoader.java | |||
@@ -8,9 +8,9 @@ package com.fourisland.fourpuzzle.util; | |||
8 | import com.fourisland.fourpuzzle.PuzzleApplication; | 8 | import com.fourisland.fourpuzzle.PuzzleApplication; |
9 | import java.awt.Color; | 9 | import java.awt.Color; |
10 | import java.awt.image.BufferedImage; | 10 | import java.awt.image.BufferedImage; |
11 | import java.io.File; | ||
12 | import java.io.IOException; | 11 | import java.io.IOException; |
13 | import java.io.InputStream; | 12 | import java.io.InputStream; |
13 | import java.net.URL; | ||
14 | import java.util.HashMap; | 14 | import java.util.HashMap; |
15 | import java.util.Map.Entry; | 15 | import java.util.Map.Entry; |
16 | import java.util.logging.Level; | 16 | import java.util.logging.Level; |
@@ -56,14 +56,8 @@ public class ObjectLoader { | |||
56 | if (!objectCache.containsKey(type + "/" + name)) | 56 | if (!objectCache.containsKey(type + "/" + name)) |
57 | { | 57 | { |
58 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); | 58 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); |
59 | String filename = rm.getResourcesDir() + type.toLowerCase() + "/" + name + ".png"; | 59 | String filename = getFilename(type, name, "png"); |
60 | InputStream str = rm.getClassLoader().getResourceAsStream(filename); | 60 | InputStream str = rm.getClassLoader().getResourceAsStream(filename); |
61 | |||
62 | if (str == null) | ||
63 | { | ||
64 | throw new ResourceNotFoundException(type, name); | ||
65 | } | ||
66 | |||
67 | BufferedImage bImg = null; | 61 | BufferedImage bImg = null; |
68 | try { | 62 | try { |
69 | bImg = ImageIO.read(str); | 63 | bImg = ImageIO.read(str); |
@@ -82,14 +76,8 @@ public class ObjectLoader { | |||
82 | if (!objectCache.containsKey(type + "/" + name)) | 76 | if (!objectCache.containsKey(type + "/" + name)) |
83 | { | 77 | { |
84 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); | 78 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); |
85 | String filename = rm.getResourcesDir() + type.toLowerCase() + "/" + name + ".png"; | 79 | String filename = getFilename(type, name, "png"); |
86 | InputStream str = rm.getClassLoader().getResourceAsStream(filename); | 80 | InputStream str = rm.getClassLoader().getResourceAsStream(filename); |
87 | |||
88 | if (str == null) | ||
89 | { | ||
90 | throw new ResourceNotFoundException(type, name); | ||
91 | } | ||
92 | |||
93 | BufferedImage bImg = null; | 81 | BufferedImage bImg = null; |
94 | try { | 82 | try { |
95 | bImg = ImageIO.read(str); | 83 | bImg = ImageIO.read(str); |
@@ -120,13 +108,8 @@ public class ObjectLoader { | |||
120 | if (!objectCache.containsKey("Music/" + name)) | 108 | if (!objectCache.containsKey("Music/" + name)) |
121 | { | 109 | { |
122 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); | 110 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); |
123 | String filename = rm.getResourcesDir() + "music/" + name + ".mid"; | 111 | String filename = getFilename("Music", name, "mid"); |
124 | InputStream str = rm.getClassLoader().getResourceAsStream(filename); | 112 | InputStream str = rm.getClassLoader().getResourceAsStream(filename); |
125 | if (str == null) | ||
126 | { | ||
127 | throw new ResourceNotFoundException("Music", name); | ||
128 | } | ||
129 | |||
130 | Sequence seq = null; | 113 | Sequence seq = null; |
131 | try { | 114 | try { |
132 | seq = MidiSystem.getSequence(str); | 115 | seq = MidiSystem.getSequence(str); |
@@ -147,7 +130,7 @@ public class ObjectLoader { | |||
147 | if (!objectCache.containsKey("Sound/" + name)) | 130 | if (!objectCache.containsKey("Sound/" + name)) |
148 | { | 131 | { |
149 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); | 132 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); |
150 | String filename = rm.getResourcesDir() + "sound/" + name + ".wav"; | 133 | String filename = getFilename("Sound", name, "wav"); |
151 | InputStream soundFile = rm.getClassLoader().getResourceAsStream(filename); | 134 | InputStream soundFile = rm.getClassLoader().getResourceAsStream(filename); |
152 | AudioInputStream ais = null; | 135 | AudioInputStream ais = null; |
153 | try { | 136 | try { |
@@ -155,7 +138,7 @@ public class ObjectLoader { | |||
155 | } catch (UnsupportedAudioFileException ex) { | 138 | } catch (UnsupportedAudioFileException ex) { |
156 | Logger.getLogger(ObjectLoader.class.getName()).log(Level.SEVERE, null, ex); | 139 | Logger.getLogger(ObjectLoader.class.getName()).log(Level.SEVERE, null, ex); |
157 | } catch (IOException ex) { | 140 | } catch (IOException ex) { |
158 | throw new ResourceNotFoundException("Sound", name); | 141 | Logger.getLogger(ObjectLoader.class.getName()).log(Level.SEVERE, null, ex); |
159 | } | 142 | } |
160 | 143 | ||
161 | AudioFormat af = ais.getFormat(); | 144 | AudioFormat af = ais.getFormat(); |
@@ -181,4 +164,24 @@ public class ObjectLoader { | |||
181 | return (Clip) objectCache.get("Sound/" + name); | 164 | return (Clip) objectCache.get("Sound/" + name); |
182 | } | 165 | } |
183 | 166 | ||
167 | public static String getFilename(String type, String name, String ex) | ||
168 | { | ||
169 | ResourceMap rm = PuzzleApplication.INSTANCE.getContext().getResourceManager().getResourceMap(); | ||
170 | String f = rm.getResourcesDir() + type.toLowerCase() + "/" + name + "." + ex; | ||
171 | URL fu = rm.getClassLoader().getResource(f); | ||
172 | |||
173 | if (fu == null) | ||
174 | { | ||
175 | f = "com/fourisland/fourpuzzle/resources/" + type.toLowerCase() + "/" + name + "." + ex; | ||
176 | fu = rm.getClassLoader().getResource(f); | ||
177 | |||
178 | if (fu == null) | ||
179 | { | ||
180 | throw new ResourceNotFoundException(type, name); | ||
181 | } | ||
182 | } | ||
183 | |||
184 | return f; | ||
185 | } | ||
186 | |||
184 | } | 187 | } |