From e456c403889d36ad1999a652ce3f3b1f45c7d528 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 3 Oct 2006 16:27:23 +0000 Subject: Removed empty frames from headgears. --- ChangeLog | 14 ++++++++++++++ src/gui/trade.cpp | 2 +- tools/Reorganize.java | 29 ++++++++++++++++++++--------- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa2a3d34..8620717f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2006-10-03 Bjørn Lindeijer + + * data/graphics/sprites/item006.xml, + data/graphics/sprites/item007.xml, + data/graphics/sprites/item008.xml, + data/graphics/sprites/item009.xml, + data/graphics/sprites/item006.png, + data/graphics/sprites/item007.png, + data/graphics/sprites/item008.png, + data/graphics/sprites/item009.png, + data/graphics/sprites/item010.xml, + data/graphics/sprites/item010.png: Removed empty frames from + headgears. + 2006-10-03 Björn Steinbrink * src/map.cpp, src/map.h, src/Makefile.am, diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index b83c6ee6..5352b23d 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -52,7 +52,7 @@ TradeWindow::TradeWindow(Network *network): mPartnerInventory(new Inventory()) { setWindowName("Trade"); - setDefaultSize(115,197,322,150); + setDefaultSize(115, 197, 322, 150); mAddButton = new Button("Add", "add", this); mOkButton = new Button("Ok", "ok", this); diff --git a/tools/Reorganize.java b/tools/Reorganize.java index 22f42604..0b9c8606 100644 --- a/tools/Reorganize.java +++ b/tools/Reorganize.java @@ -12,7 +12,7 @@ import java.io.File; import javax.imageio.ImageIO; /** - * Tool to reorganize the hair spritesets. + * Tool to reorganize the headgears. */ public class Reorganize { @@ -47,7 +47,7 @@ public class Reorganize // Read the existing frames into a vector Vector spriteSet = gridCut(source, HAIR_SPRITE_WIDTH, HAIR_SPRITE_HEIGHT, - HAIR_FRAMES, HAIR_COLORS); + HAIR_FRAMES, 1); // Determine minimal rectangle that can still contain the contents of // any frame @@ -60,21 +60,16 @@ public class Reorganize System.exit(1); } - // Make crop rect one pixel larger (since we want an inclusive rect) - cropRect.add( - cropRect.x + cropRect.width + 1, - cropRect.y + cropRect.height + 1); - System.out.println(arg[0] + ": width=\"" + cropRect.width + "\" height=\"" + cropRect.height + "\""); */ - filterHairstyle(spriteSet); + filterHeadgear(spriteSet); BufferedImage target = gridDraw( spriteSet, new Rectangle(0, 0, HAIR_SPRITE_WIDTH, HAIR_SPRITE_HEIGHT), - HAIR_FRAMES - 4, HAIR_COLORS); + HAIR_FRAMES - 4, 1); // Save the target image try { @@ -149,6 +144,13 @@ public class Reorganize } } + // Make crop rect one pixel larger (since we want an inclusive rect) + if (cropRect != null) { + cropRect.add( + cropRect.x + cropRect.width + 1, + cropRect.y + cropRect.height + 1); + } + return cropRect; } @@ -184,4 +186,13 @@ public class Reorganize spriteSet.remove(i * HAIR_FRAMES + 1); } } + + private static void filterHeadgear(Vector spriteSet) + { + // Remove frame 1, 2, 6 and 7 + spriteSet.remove(7); + spriteSet.remove(6); + spriteSet.remove(2); + spriteSet.remove(1); + } } -- cgit v1.2.3-70-g09d2