diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | data/graphics/Makefile.am | 2 | ||||
-rw-r--r-- | data/graphics/images/Makefile.am | 2 | ||||
-rw-r--r-- | tools/tmxcopy/main.cpp | 16 | ||||
-rw-r--r-- | tools/tmxcopy/map.cpp | 17 | ||||
-rw-r--r-- | tools/tmxcopy/zlibutils.cpp | 2 |
6 files changed, 29 insertions, 22 deletions
@@ -230,6 +230,16 @@ data/graphics/sprites/scorpion.xml: Gave the tail attack of the scorpion a custom animation and a particle effect. +2008-03-08 Philipp Sehmisch <tmw@crushnet.org> + + * tools/tmxcopy/main.cpp, tools/tmxcopy/main.map.cpp, + tools/tmxcopy/plibutils.cpp: Fixed some width/height mixups in + TMXCopy. + +2008-03-07 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * data/*: Moved dynamically released data to its own module (tmwdata). + 2008-03-07 Eugenio Favalli <elvenprogrammer@themanaworld.org> * data/equipment.xml, data/graphics/items/armor-legs-chaps.png, @@ -248,8 +258,6 @@ data/graphics/sprites/monster-snake.xml, data/graphics/sprites/npcs.png, data/items.xml, data/monsters.xml: Added new items by Black Don, new xml definitions by Peavey. - * data/graphics/items/armor-head-cowboyblack.png, - data/graphics/items/armor-head-cowboywhite.png: Corrected names. 2008-03-06 David Athay <ko2fan@gmail.com> diff --git a/data/graphics/Makefile.am b/data/graphics/Makefile.am index 8cda8fa3..1f0db5ff 100644 --- a/data/graphics/Makefile.am +++ b/data/graphics/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = gui images tiles +SUBDIRS = gui images diff --git a/data/graphics/images/Makefile.am b/data/graphics/images/Makefile.am index be8593f6..4df6b7ed 100644 --- a/data/graphics/images/Makefile.am +++ b/data/graphics/images/Makefile.am @@ -1,5 +1,3 @@ -SUBDIRS = ambient - imagesdir = $(pkgdatadir)/data/graphics/images images_DATA = \ diff --git a/tools/tmxcopy/main.cpp b/tools/tmxcopy/main.cpp index 3d460961..92a69c54 100644 --- a/tools/tmxcopy/main.cpp +++ b/tools/tmxcopy/main.cpp @@ -28,15 +28,15 @@ int main(int argc, char * argv[] ) // parsing command line options if (argc < 9 || argc > 10) { - std::cerr<<"Usage: srcFile x y height width tgtFile x y [outfile]"; + std::cerr<<"Usage: srcFile x y width height tgtFile x y [outfile]"; return -1; } std::string srcFile = argv[1]; int srcX= atoi(argv[2]); int srcY= atoi(argv[3]); - int height= atoi(argv[4]); - int width=atoi(argv[5]); + int width= atoi(argv[4]); + int height=atoi(argv[5]); std::string tgtFile = argv[6]; int destX=atoi(argv[7]); int destY=atoi(argv[8]); @@ -44,7 +44,7 @@ int main(int argc, char * argv[] ) if (argc == 10) outFile = argv[9]; // plausibility check of command line options - if (height < 1 || width < 1 || srcX < 1 || srcY < 1 || destX < 1 || destY < 1) + if (height < 1 || width < 1 || srcX < 0 || srcY < 0 || destX < 0 || destY < 0) { std::cerr<<"Illegal coordinates!"<<std::endl; std::cerr<<"Usage: sourceFile x y height width targetFile x y [outputFile]"<<std::endl; @@ -55,8 +55,12 @@ int main(int argc, char * argv[] ) { Map* srcMap = new Map(srcFile); Map* tgtMap = new Map(tgtFile); - tgtMap->overwrite(srcMap, srcX, srcY, height, width, destX, destY); - tgtMap->save(outFile); + if (tgtMap->overwrite(srcMap, srcX, srcY, width, height, destX, destY)) + { + tgtMap->save(outFile); + } else { + return -1; + } } catch (int) { diff --git a/tools/tmxcopy/map.cpp b/tools/tmxcopy/map.cpp index 0674ae1a..e0212e37 100644 --- a/tools/tmxcopy/map.cpp +++ b/tools/tmxcopy/map.cpp @@ -188,19 +188,19 @@ bool Map::overwrite( Map* srcMap, //plausibility check of coordinates bool checkPassed = true; if (srcX + srcWidth > srcMap->getWidth()) { - std::cerr<<"Error: Area exceeds right map border of source map!"; + std::cerr<<"Error: Area exceeds right map border of source map!"<<std::endl; checkPassed = false; } if (srcY + srcHeight > srcMap->getHeight()) { - std::cerr<<"Error: Area exceeds lower map border of source map!"; + std::cerr<<"Error: Area exceeds lower map border of source map!"<<std::endl; checkPassed = false; } if (destX + srcWidth > mWidth) { - std::cerr<<"Error: Area exceeds right map border of target map!"; + std::cerr<<"Error: Area exceeds right map border of target map!"<<std::endl; checkPassed = false; } if (destY + srcHeight > mHeight) { - std::cerr<<"Error: Area exceeds lower map border of target map!"; + std::cerr<<"Error: Area exceeds lower map border of target map!"<<std::endl; checkPassed = false; } if (!checkPassed) return false; @@ -235,10 +235,10 @@ bool Map::overwrite( Map* srcMap, Layer* srcLayer = srcMap->getLayer(i); Layer* destLayer = mLayers.at(i); - for (int y=0; y<srcWidth; y++) + for (int y=0; y<srcHeight; y++) { - for (int x=0; x<srcHeight; x++) + for (int x=0; x<srcWidth; x++) { int srcIndex = srcMap->getWidth() * (y + srcY) + (x + srcX); int tgtIndex = mWidth * (y + destY) + (x + destX); @@ -319,8 +319,7 @@ int Map::save(std::string filename) } - // GZIP layer information - // Doesn't work yet. + //GZIP layer information /* unsigned char* gzipData = (unsigned char*)malloc((mWidth * mHeight * 4) + 128); unsigned int gzipLen; @@ -365,7 +364,7 @@ int Map::save(std::string filename) } else { - std::cout<<"File saved successfully to"<<filename<<std::endl; + std::cout<<"File saved successfully to "<<filename<<std::endl; return true; } } diff --git a/tools/tmxcopy/zlibutils.cpp b/tools/tmxcopy/zlibutils.cpp index 30c762b2..9145f459 100644 --- a/tools/tmxcopy/zlibutils.cpp +++ b/tools/tmxcopy/zlibutils.cpp @@ -109,8 +109,6 @@ inflateMemory(unsigned char *in, unsigned int inLength, } /* - * This function doesn't work like it should. The output is not decompressable. - */ int compressMemory(unsigned char *in, unsigned int inLength, unsigned char *&out, unsigned int &outLength) |