From: <aki...@us...> - 2006-06-25 11:21:43
|
Revision: 179 Author: akirschbaum Date: 2006-06-25 04:21:38 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=179&view=rev Log Message: ----------- Fix typo in variable name; it sometimes did not delete all object from a resized map. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 11:05:32 UTC (rev 178) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 11:21:38 UTC (rev 179) @@ -1064,7 +1064,7 @@ // (and yes, there is an area getting sweeped twice - and yes it could // be optimized you smartass - but I don't care!) for (int y = newSize.height; y < mapSize.height; y++) { - for (int x = 0; x < mapSize.height; x++) { + for (int x = 0; x < mapSize.width; x++) { // for every map square: delete all arches on it final Iterator it = getArchObjectsDeleteMapArch(x, y, false, false); while (it.hasNext()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-08-13 13:46:06
|
Revision: 255 Author: akirschbaum Date: 2006-08-13 06:45:58 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=255&view=rev Log Message: ----------- Remove loop with constant iteration count of one. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-13 13:28:29 UTC (rev 254) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-13 13:45:58 UTC (rev 255) @@ -638,51 +638,49 @@ final int mapx = arch.getMapX(); final int mapy = arch.getMapY(); - for (int c = 0; c <= 0; c++) { - if (oldarch != null) { - arch.setMapMultiHead(startarch); - oldarch.setMapMultiNext(arch); - } else { - startarch = arch; - } - oldarch = arch; + if (oldarch != null) { + arch.setMapMultiHead(startarch); + oldarch.setMapMultiNext(arch); + } else { + startarch = arch; + } + oldarch = arch; - // insert ít in map or add to arch in map - ArchObject node = mapGrid[mapx][mapy]; - if (node == null) { - mapGrid[mapx][mapy] = arch; - mapGrid[mapx][mapy].setMapX(mapx); - mapGrid[mapx][mapy].setMapY(mapy); - } else { - if (!insertBelow) { - // if we want to insert on top, we need to get last node element - for (int i = 0; node.getNext() != null; i++) { - node = node.getNext(); - } - - node.setNext(arch); - node.getNext().setPrev(node); - node.getNext().setMapX(mapx); - node.getNext().setMapY(mapy); - } else { - // insert below, so just put it on first place - node.setPrev(arch); - arch.setNext(node); - mapGrid[mapx][mapy] = arch; - arch.setMapX(mapx); - arch.setMapY(mapy); - arch.propagateElevation(node); + // insert ít in map or add to arch in map + ArchObject node = mapGrid[mapx][mapy]; + if (node == null) { + mapGrid[mapx][mapy] = arch; + mapGrid[mapx][mapy].setMapX(mapx); + mapGrid[mapx][mapy].setMapY(mapy); + } else { + if (!insertBelow) { + // if we want to insert on top, we need to get last node element + for (int i = 0; node.getNext() != null; i++) { + node = node.getNext(); } - } - // calculate edit type - if (arch.isReferenced() && arch.getMapMultiHead() != null) { - arch.setEditType(arch.getMapMultiHead().getEditType()); // copy from head - } else if (mapControl.getActiveEditType() != 0) { - arch.setEditType(arch.calculateEditType(mapControl.getActiveEditType())); // calculate new + node.setNext(arch); + node.getNext().setPrev(node); + node.getNext().setMapX(mapx); + node.getNext().setMapY(mapy); + } else { + // insert below, so just put it on first place + node.setPrev(arch); + arch.setNext(node); + mapGrid[mapx][mapy] = arch; + arch.setMapX(mapx); + arch.setMapY(mapy); + arch.propagateElevation(node); } } + // calculate edit type + if (arch.isReferenced() && arch.getMapMultiHead() != null) { + arch.setEditType(arch.getMapMultiHead().getEditType()); // copy from head + } else if (mapControl.getActiveEditType() != 0) { + arch.setEditType(arch.calculateEditType(mapControl.getActiveEditType())); // calculate new + } + setLevelChangedFlag(); // Level data has changed return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-08-27 14:46:12
|
Revision: 283 Author: akirschbaum Date: 2006-08-27 07:27:17 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=283&view=rev Log Message: ----------- Remove variable that always is null. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-27 14:25:53 UTC (rev 282) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-27 14:27:17 UTC (rev 283) @@ -626,25 +626,18 @@ * is inserted below */ public void addArchObjectToMap(final ArchObject arch, final boolean insertBelow) { - ArchObject oldarch, startarch; // our new suckers (copys, not ref ptrs) + ArchObject startarch; // our new suckers (copys, not ref ptrs) // Make sure this arch has the proper edit_type if (arch.getEditType() == IGUIConstants.TILE_EDIT_NONE) { arch.calculateEditType(mapControl.getActiveEditType()); } - oldarch = null; startarch = null; final int mapx = arch.getMapX(); final int mapy = arch.getMapY(); - if (oldarch != null) { - arch.setMapMultiHead(startarch); - oldarch.setMapMultiNext(arch); - } else { - startarch = arch; - } - oldarch = arch; + startarch = arch; // insert ít in map or add to arch in map ArchObject node = mapGrid[mapx][mapy]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |