Mercurial > hg > ristipolku
comparison game/Engine.java @ 69:163232ec225b
Stream music data instead of loading to memory.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 25 Feb 2011 08:29:06 +0200 |
parents | 52897e3865bf |
children | 2a7fd02504fa |
comparison
equal
deleted
inserted
replaced
68:52897e3865bf | 69:163232ec225b |
---|---|
331 BufferedImage lautaBG = null, lautaBGScaled = null; | 331 BufferedImage lautaBG = null, lautaBGScaled = null; |
332 Dimension lautaDim; | 332 Dimension lautaDim; |
333 | 333 |
334 static final AudioFormat sfmt = new AudioFormat(22050, 16, 1, true, false); | 334 static final AudioFormat sfmt = new AudioFormat(22050, 16, 1, true, false); |
335 SoundManager soundManager; | 335 SoundManager soundManager; |
336 Sound musa; | 336 InputStream musa; |
337 | 337 |
338 boolean aboutEnabled = false, aboutSecret = false; | 338 boolean aboutEnabled = false, aboutSecret = false; |
339 BufferedImage aboutImg = null; | 339 BufferedImage aboutImg = null; |
340 | 340 |
341 IDMContainer widgets; | 341 IDMContainer widgets; |
367 catch (FontFormatException e) | 367 catch (FontFormatException e) |
368 { | 368 { |
369 System.out.print("Could not initialize fonts.\n"); | 369 System.out.print("Could not initialize fonts.\n"); |
370 } | 370 } |
371 | 371 |
372 musa = soundManager.getSound("sounds/gamemusic.wav"); | 372 res = new ResourceLoader("sounds/gamemusic.wav"); |
373 musa = res.getStream(); | |
373 } | 374 } |
374 catch (IOException e) | 375 catch (IOException e) |
375 { | 376 { |
376 JOptionPane.showMessageDialog(null, | 377 JOptionPane.showMessageDialog(null, |
377 e.getMessage(), | 378 e.getMessage(), |