Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/jgame.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 140 by tsugehara, Sat Aug 3 17:18:10 2013 UTC revision 141 by tsugehara, Sun Aug 4 07:07:23 2013 UTC
# Line 2083  var jg; Line 2083  var jg;
2083              var th = this.tile.tileHeight;              var th = this.tile.tileHeight;
2084              var tw2 = Math.floor(this.tile.tileWidth / 2);              var tw2 = Math.floor(this.tile.tileWidth / 2);
2085              var th2 = Math.floor(this.tile.tileHeight / 2);              var th2 = Math.floor(this.tile.tileHeight / 2);
2086              var chip = this.tile.data[x][y];              chip += this.chipOffset;
2087              for (var i = 0; i < 4; i++) {              for (var i = 0; i < 2; i++) {
2088                  for (var j = 0; j < 4; j++) {                  for (var j = 0; j < 2; j++) {
2089                      var ox = x + (Math.floor((i + 1) / 2) - 1);                      var tx = x + (i == 0 ? -1 : 1);
2090                      var oy = y + (Math.floor((j + 1) / 2) - 1);                      var ty = y + (j == 0 ? -1 : 1);
2091                      var n = this.map(ox, oy);                      var v = this.map(tx, y);
2092                      if (n == -1 || n != chip)                      var h = this.map(x, ty);
                         continue;  
   
                     var tx = ox + (i % 2 == 0 ? 1 : -1);  
                     var ty = oy + (j % 2 == 0 ? 1 : -1);  
                     var sel;  
                     var v = this.map(tx, oy);  
                     var h = this.map(ox, ty);  
2093                      var vh = this.map(tx, ty);                      var vh = this.map(tx, ty);
2094                      sel = 0;                      var sel = 0;
2095                      if (h == n)                      if (h == chip)
2096                          sel++;                          sel++;
2097                      if (v == n)                      if (v == chip)
2098                          sel += 2;                          sel += 2;
2099                      if (sel == 3 && vh == n)                      if (sel == 3 && vh == chip)
2100                          sel++;                          sel++;
2101    
2102                      c.drawImage(this.image, (sel % this.sep) * tw + tw2 * (i % 2 == 0 ? 1 : 0), Math.floor(sel / this.sep) * th + th2 * (j % 2 == 0 ? 1 : 0), tw2, th2, x * tw + tw2 * (i - 1), y * th + th2 * (j - 1), tw2, th2);                      c.drawImage(this.image, (sel % this.sep) * tw + tw2 * i, Math.floor(sel / this.sep) * th + th2 * j, tw2, th2, x * tw + tw2 * i, y * th + th2 * j, tw2, th2);
2103                  }                  }
2104              }              }
2105          };          };

Legend:
Removed from v.140  
changed lines
  Added in v.141

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26