Possibilité de placer un sprite d'une couche sans nécessité qu'une
couche précédente existe
This commit is contained in:
parent
1c2d673bec
commit
c47939957d
|
@ -42,32 +42,32 @@ public class MapPanel extends JPanel
|
||||||
|
|
||||||
for (Case c : getMap().getAllCases())
|
for (Case c : getMap().getAllCases())
|
||||||
{
|
{
|
||||||
if (isEmpty(c.getCoucheOne().getImage()))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// BufferedImage image;
|
// BufferedImage image;
|
||||||
|
|
||||||
g.drawImage(c.getCoucheOne().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
if (!isEmpty(c.getCoucheOne().getImage()))
|
||||||
|
{
|
||||||
|
g.drawImage(c.getCoucheOne().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
|
}
|
||||||
/* if (frame.getSelectedLayerIndex() != 0)
|
/* if (frame.getSelectedLayerIndex() != 0)
|
||||||
{
|
{
|
||||||
image = recalculateAplha(c.getCoucheOne().getImage(), 0);
|
image = recalculateAplha(c.getCoucheOne().getImage(), 0);
|
||||||
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (isEmpty(c.getCoucheTwo().getImage()) || (frame.getSelectedLayerIndex() != 1 && frame.getSelectedLayerIndex() != 2))
|
if (!isEmpty(c.getCoucheTwo().getImage()) || (frame.getSelectedLayerIndex() != 1 && frame.getSelectedLayerIndex() != 2))
|
||||||
continue;
|
{
|
||||||
|
g.drawImage(c.getCoucheTwo().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
g.drawImage(c.getCoucheTwo().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
}
|
||||||
/* if (frame.getSelectedLayerIndex() != 1)
|
/* if (frame.getSelectedLayerIndex() != 1)
|
||||||
{
|
{
|
||||||
image = recalculateAplha(c.getCoucheTwo().getImage(), 1);
|
image = recalculateAplha(c.getCoucheTwo().getImage(), 1);
|
||||||
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (isEmpty(c.getCoucheThree().getImage()) || frame.getSelectedLayerIndex() != 2)
|
if (!isEmpty(c.getCoucheThree().getImage()) || frame.getSelectedLayerIndex() != 2)
|
||||||
continue;
|
{
|
||||||
|
g.drawImage(c.getCoucheThree().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
g.drawImage(c.getCoucheThree().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
}
|
||||||
/* if (frame.getSelectedLayerIndex() != 2)
|
/* if (frame.getSelectedLayerIndex() != 2)
|
||||||
{
|
{
|
||||||
image = recalculateAplha(c.getCoucheThree().getImage(), 2);
|
image = recalculateAplha(c.getCoucheThree().getImage(), 2);
|
||||||
|
|
|
@ -39,9 +39,6 @@ public class MapMouseListener extends MouseAdapter
|
||||||
{
|
{
|
||||||
if (getFrame().getSelectedSprite() != null)
|
if (getFrame().getSelectedSprite() != null)
|
||||||
{
|
{
|
||||||
if (getFrame().getSelectedSprite().getCouche() - 1 > getFrame().getSelectedLayerIndex())
|
|
||||||
return;
|
|
||||||
|
|
||||||
Case n;
|
Case n;
|
||||||
|
|
||||||
switch (getFrame().getSelectedSprite().getCouche())
|
switch (getFrame().getSelectedSprite().getCouche())
|
||||||
|
|
Loading…
Reference in New Issue