|
From: <cl...@us...> - 2007-08-17 03:25:59
|
Revision: 82
http://fortress.svn.sourceforge.net/fortress/?rev=82&view=rev
Author: clrg
Date: 2007-08-16 20:25:55 -0700 (Thu, 16 Aug 2007)
Log Message:
-----------
Some refactoring
Modified Paths:
--------------
trunk/client/src/net/sourceforge/fortress/isogrid.t
trunk/client/src/net/sourceforge/fortress/preloadimages.t
trunk/client/src/net/sourceforge/fortress/twoquarter.t
Added Paths:
-----------
trunk/client/src/net/sourceforge/fortress/iso96/squaretower/top1.png
trunk/client/src/net/sourceforge/fortress/iso96/squaretower/top2.png
Added: trunk/client/src/net/sourceforge/fortress/iso96/squaretower/top1.png
===================================================================
(Binary files differ)
Property changes on: trunk/client/src/net/sourceforge/fortress/iso96/squaretower/top1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/client/src/net/sourceforge/fortress/iso96/squaretower/top2.png
===================================================================
(Binary files differ)
Property changes on: trunk/client/src/net/sourceforge/fortress/iso96/squaretower/top2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/client/src/net/sourceforge/fortress/isogrid.t
===================================================================
(Binary files differ)
Modified: trunk/client/src/net/sourceforge/fortress/preloadimages.t
===================================================================
(Binary files differ)
Modified: trunk/client/src/net/sourceforge/fortress/twoquarter.t
===================================================================
--- trunk/client/src/net/sourceforge/fortress/twoquarter.t 2007-08-16 15:55:48 UTC (rev 81)
+++ trunk/client/src/net/sourceforge/fortress/twoquarter.t 2007-08-17 03:25:55 UTC (rev 82)
@@ -22,28 +22,34 @@
// used to give the graphics a non-repeating feel
thisbox.seed = vexi.math.floor(vexi.math.random()*10);
// used to set the base fill of the tile
- thisbox.type = "grass";
+ thisbox.tile = "grass";
- var sync = function() { fill = .image[type][type+seed]; }
+ var sync = function() { fill = .iso96[tile][tile+seed]; }
sync();
- thisbox.addPiece = function(type, top, left)
+ thisbox.addPiece = function(type, top, left, zoffset)
{
- var z = static.zindex[type];
+ type = type.split('.');
+ var z = static.zindex[type[0]];
if (z == null) throw "tried to add nonregistered type '"+type+"' from "+posx+", "+posy;
+ // dont add null/undeclared to z
+ z += zoffset ? zoffset : 0;
+ var p;
var i = 0;
- var p;
while (numchildren > i)
{
p = thisbox[i];
- if (p.type == type and p.left == left and p.top == top)
- throw "tried to add a duplicate tile piece of type '"+type+"' from "+posx+", "+posy;
+ if (p.z == z and p.left == left and p.top == top)
+ throw "tried to add a duplicate tile piece of type '"+type[0]+"' from "+posx+", "+posy;
if (p.z > z) break;
i++;
}
+ var r = .iso96;
+ for (var i=0; type.length>i; i++)
+ r = r[type[i]];
var b = vexi.box;
- b.fill = .image[static.tileset][type];
+ b.fill = r;
b.left = left;
b.top = top;
b.shrink = true;
@@ -56,13 +62,17 @@
return b;
}
- thisbox.delPiece = function(type, top, left)
+ thisbox.delPiece = function(type, top, left, zoffset)
{
+ var z = static.zindex[type];
+ if (z == null) throw "tried to add nonregistered type '"+type+"' from "+posx+", "+posy;
+ // dont add null/undeclared to z
+ z += zoffset ? zoffset : 0;
var p;
for (var i=0; numchildren>i; i++)
{
p = thisbox[i];
- if (p.type == type and p.left == left and p.top == top)
+ if (p.z == z and p.left == left and p.top == top)
{
thisbox[i] = null;
return;
@@ -103,9 +113,7 @@
{
register("highlight");
register("grid");
- register("towerbase");
- register("towerstem");
- register("towertop");
+ register("squaretower");
}
{ init(); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|