add a .xpm file as background / first TEST /

- add a special cat image in background
- now ready for a pixel art phase ...
- very quick&dirty implementation of xpm parser...

- xpm generated with gimp using posterize. Thanks gimp !
This commit is contained in:
philippe lhardy
2020-12-13 22:44:09 +01:00
parent 56585712c8
commit 338dc3dd6b
4 changed files with 1218 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ import org.artisanlogiciel.graphics.SvgWriter;
import org.artisanlogiciel.osm.OsmReader;
import org.artisanlogiciel.osm.convert.OsmToDrawing;
import org.artisanlogiciel.util.UTF8Control;
import org.artisanlogiciel.xpm.Xpm;
import javax.imageio.ImageIO;
import javax.swing.*;
@@ -87,6 +88,16 @@ implements StatusListener
private MazeComponent createMazeComponent(LabyModel model, int W, int H) {
MazeCellParameters cp = new MazeCellParameters(model.getWidth(), model.getHeight(), W, H, 3, 3);
MazeComponent comp = new MazeComponent(model, cp, this);
Xpm xpm = new Xpm();
// HARDCODED FOR FIRST TEST FIXME !!!
try {
xpm.parse(new FileInputStream("lab/titou20.xpm"));
comp.setXpm(xpm);
}
catch(Exception e)
{
System.err.println("Hardcoded background to fix");
}
return comp;
}