チェンジセット 1525
- コミット日時:
- 2008/10/06 03:04:28 (3 年前)
- ファイル:
-
- ruby/jsplash/trunk/client2/index.xml (更新) (1 diff)
- ruby/jsplash/trunk/client2/jsplash/executor.js (更新) (5 diffs)
- ruby/jsplash/trunk/client2/jsplash/objects.js (更新) (10 diffs)
- ruby/jsplash/trunk/client2/jsplash/player.js (更新) (1 diff)
- ruby/jsplash/trunk/client2/jsplash/shaperenderer.js (更新) (12 diffs)
- ruby/jsplash/trunk/client2/jsplash/tags.js (更新) (1 diff)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
ruby/jsplash/trunk/client2/index.xml
r1517 r1525 54 54 <div id="progbar"><div> </div></div> 55 55 <p id="statusout"> </p> 56 <p id="sout"><em>JSplash Player</em> 0.4. 4<br />-------------------------------------<br /></p>56 <p id="sout"><em>JSplash Player</em> 0.4.5<br />-------------------------------------<br /></p> 57 57 <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 58 58 </svg> ruby/jsplash/trunk/client2/jsplash/executor.js
r1517 r1525 8 8 this.targets = {}; 9 9 this.reservedActions = null; 10 this.executed_stat = 0; 10 11 11 12 this.additionals = null; … … 74 75 75 76 tick: function() { 77 this.executed_stat = 0; 76 78 var eid, tlist = this.targets; 77 79 var mobj; … … 125 127 // JSplash.$putstat("view objects: " + topsvg.length + " / " + icounts.join(' ')); 126 128 127 JSplash.$putstat("top level views: " + topsvg.length + " total shapes: " + JSplash.gPlayer.disposer.stats );129 JSplash.$putstat("top level views: " + topsvg.length + " total shapes: " + JSplash.gPlayer.disposer.stats + " executed tags: "+this.executed_stat ); 128 130 129 131 } 130 132 //////////////////////////////////// debug 131 133 132 t = Math.floor( 1000 / this.frameRate);134 t = Math.floor(950 / this.frameRate); 133 135 134 136 … … 140 142 141 143 advanceFrame: function(mobj, jumps) { 144 if (mobj.sleeping) 145 return; 146 142 147 if (this.executed[mobj.instance_uid] && !jumps && mobj.context.tagC) 143 148 return; … … 146 151 for(;jumps>=0;jumps--) { 147 152 while(1) { 153 this.executed_stat++; 148 154 var res = mobj.executeNextTag(jumps != 0); 149 155 if (res == JSplash.EXECUTED_SHOWFRAME) break; 150 156 } 151 157 } 158 }, 159 160 sleepAll: function() { 161 var eid, tlist = this.targets; 162 for (eid in tlist) 163 tlist[eid].sleep(); 152 164 }, 153 165 ruby/jsplash/trunk/client2/jsplash/objects.js
r1520 r1525 61 61 62 62 getProxy: function() { 63 if (this.klass.isShapeObject) 64 return null; 65 63 66 if (!this.proxy) 64 67 this.proxy = new JSplash.MovieClipProxy(this); … … 128 131 129 132 this.sleeping = false; 130 this.play(); 131 this.rewind(); 133 if (!this.klass.isShapeObject) 134 { 135 this.play(); 136 this.rewind(); 137 } 132 138 } 133 139 … … 180 186 }, 181 187 182 placeObject: function(depth, oid, iname, clip_depth, inherit_transform) {188 placeObject: function(depth, oid, iname, clip_depth, replace_flg, inherit_transform) { 183 189 if (clip_depth) 184 190 this.clipMap[depth] = clip_depth; … … 219 225 /* when replace previous frame */ 220 226 var g_before = null; 221 if (inherit_transform && inst && replaced) { 222 inst.copyTransformFrom(replaced); 227 if (replace_flg && inst && replaced) { 228 if (inherit_transform) 229 inst.copyTransformFrom(replaced); 223 230 g_before = replaced.g; /* to correct draw order*/ 224 231 } … … 239 246 { 240 247 //try { 241 try{ 242 this.g.insertBefore(inst.g, g_before); 243 }catch(e){return null;} 248 249 if (this.taglist.length > JSplash.ObjectInstance.REMOVE_THRESH) 250 { 251 this.g.replaceChild(inst.g, g_before); 252 replaced.appended = false; 253 } 254 else 255 this.g.insertBefore(inst.g, g_before); 256 244 257 //} catch (e) { 245 258 //this.trace(); … … 348 361 this.hideClippers(); 349 362 350 if (this.g && this.g.childNodes.length > 0 )363 if (this.g && this.g.childNodes.length > 0 && !this.klass.isShapeObject) 351 364 this.updateProxy(); 352 365 }, … … 381 394 } 382 395 } 383 396 384 397 this.context.frameC = 0; 385 398 this.context.tagC = 0; … … 526 539 527 540 this.updateTransform(); 528 this.updateProxy(); 541 542 if (!this.klass.isShapeObject) 543 this.updateProxy(); 529 544 }, 530 545 … … 538 553 539 554 this.updateTransform(); 540 this.updateProxy(); 555 556 if (!this.klass.isShapeObject) 557 this.updateProxy(); 541 558 }, 542 559 … … 633 650 s.label_map = label_map; 634 651 s.mouse_down = false; 652 s.is_stage = true; 635 653 636 654 Object.extend(s, { ruby/jsplash/trunk/client2/jsplash/player.js
r1517 r1525 51 51 onTopMouseDown: function(e) { 52 52 if (Event.isLeftClick(e)) 53 { 53 54 this.stage.setMouseDown(); 55 e.preventDefault(); 56 } 54 57 }, 55 58 ruby/jsplash/trunk/client2/jsplash/shaperenderer.js
r1494 r1525 14 14 this.te_id = 0; 15 15 this.fillDefMap = {}; 16 this.hitCount = 0; 17 this.pathCache = null; 18 this.do_cache = false; 16 19 }, 17 20 … … 53 56 { 54 57 attrs.r = 819; 58 attrs.fx = 0; 59 attrs.fy = 0; 55 60 } 56 61 … … 279 284 return a.index - b.index; 280 285 }, 281 286 /* 282 287 buildFills: function(g) { 283 288 var loopss = this.fillLoops; … … 289 294 this.buildAFill(loopss[i].loops, this.fillStyles[loopss[i].fill_index-1], g); 290 295 } 291 /* 292 293 var elist = this.edgeList; 294 var next_fi = null; 295 var edge_start = 0; 296 var edge_end = elist.length; 297 298 if (this.layerStartIndices.length) 299 { 300 next_fi = this.layerStartIndices[0].fi; 301 edge_end = this.layerStartIndices[0].ei; 302 this.layerStartIndices.shift(); 303 } 304 305 306 for (var i = 0;i < len;i++) { 307 if (next_fi && loopss[i].fill_index >= next_fi) { 308 this.buildEdges(g, edge_start, edge_end); 309 310 edge_start = edge_end; 311 if (this.layerStartIndices.length) { 312 next_fi = this.layerStartIndices[0].fi; 313 edge_end = this.layerStartIndices[0].ei; 314 this.layerStartIndices.shift(); 315 } 316 else { 317 next_fi = null; 318 edge_end = elist.length; 319 } 320 321 } 322 323 this.buildAFill(loopss[i].loops, this.fillStyles[loopss[i].fill_index-1], g); 324 } 325 326 this.buildEdges(g, edge_start, edge_end);*/ 327 }, 296 }, 297 */ 328 298 329 299 buildAFill: function(list, fi, g) { … … 339 309 if (!style_str) return; 340 310 341 342 311 var len = list.length; 343 312 var commands = [], lp, k, llen, E; … … 371 340 attrs.opacity = style.a; 372 341 } 373 g.appendChild( JSplash.$svg('path', attrs) ); 374 }, 375 342 343 var elem = JSplash.$svg('path', attrs); 344 if (this.do_cache) 345 this.pathCache.stock(elem); 346 g.appendChild( elem ); 347 }, 348 /* 376 349 buildALoop: function(lp, style, g) { 377 350 if (!style) return; … … 402 375 g.appendChild( JSplash.$svg('path', {d: commands.join(' '), fill: style_str}) ); 403 376 }, 404 377 */ 405 378 buildEdges: function(g, edge_start, edge_end) { 406 var E ;379 var E, elem; 407 380 var edges = this.edgeList; 408 381 var len = edges.length; … … 432 405 attrs = {d: commands.join(' '), fill: 'none', stroke: curStyle, 'stroke-width': curWidth}; 433 406 if (curAlpha != undefined) attrs['stroke-opacity'] = curAlpha; 407 408 elem = JSplash.$svg('path', attrs); 409 if (this.do_cache) 410 this.pathCache.stock(elem); 434 411 435 paths.push( JSplash.$svg('path', attrs));412 paths.push(elem); 436 413 } 437 414 } … … 469 446 if (curAlpha != undefined) attrs['stroke-opacity'] = curAlpha; 470 447 471 paths.push(JSplash.$svg('path', attrs)); 448 elem = JSplash.$svg('path', attrs); 449 if (this.do_cache) 450 this.pathCache.stock(elem); 451 452 paths.push(elem); 472 453 } 473 454 for (;paths.length;) … … 476 457 477 458 buildSVG: function(g) { 478 this.buildDrawOrder(); 479 this.renderDisplayList(g); 459 if (this.hitCount == 2) { 460 this.pathCache = new JSplash.ShapeRenderer.PathCache(); 461 this.do_cache = true; 462 } 463 464 if (this.pathCache && !this.do_cache) 465 this.pathCache.tearOff(g); 466 else { 467 this.buildDrawOrder(); 468 this.renderDisplayList(g); 469 } 470 471 this.do_cache = false; 472 this.hitCount++; 480 473 return g; 481 474 }, … … 509 502 var lps = this.makeLoop(collected_edges, fi); 510 503 if (lps.length > 0) { 511 this.fillLoops.push({fill_index: fi, loops: lps });504 this.fillLoops.push({fill_index: fi, loops: lps /* cache: undefined */ }); 512 505 } 513 506 } … … 704 697 } 705 698 } 699 700 JSplash.ShapeRenderer.PathCache = Class.create(); 701 JSplash.ShapeRenderer.PathCache.prototype = { 702 initialize: function() { 703 this.stocks = []; 704 }, 705 706 stock: function(elem) { 707 this.stocks.push(elem /* not clone! don't modify... */ ); 708 }, 709 710 tearOff: function(target) { 711 var len = this.stocks.length; 712 for (var i = 0;i < len;i++) 713 target.appendChild( this.stocks[i].cloneNode(false) ); 714 } 715 } ruby/jsplash/trunk/client2/jsplash/tags.js
r1494 r1525 11 11 12 12 tPlaceObject2: function(data, owner) { 13 var inst = owner.placeObject(data.d, data.id, data.name, data.cl, data.r); 13 var has_trans = (data.mov || data.scl || data.skw); 14 15 var inst = owner.placeObject(data.d, data.id, data.name, data.cl, data.r, (data.r && !has_trans)); 14 16 if (!inst) { 15 17 console.warn("WARNING: unregistered object id="+data.d); 16 18 return; 17 19 } 18 if ( data.mov || data.scl || data.skw) {20 if (has_trans) { 19 21 var tx = 0, ty = 0; 20 22 var sx = 1, sy = 1;

