初始化

This commit is contained in:
SmallMain
2022-06-25 00:23:03 +08:00
commit ef0589e8e5
2264 changed files with 617829 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
(function(){
if(!cc.Sprite.__assembler__.BarFilled3D) return;
let proto = cc.Sprite.__assembler__.BarFilled3D.prototype;
Object.assign(proto, {
updateWorldVerts: cc.Assembler3D.updateWorldVerts
})
})()

View File

@@ -0,0 +1,20 @@
(function(){
if(!cc.Sprite.__assembler__.Mesh3D) return;
let proto = cc.Sprite.__assembler__.Mesh3D.prototype;
Object.assign(proto, {
updateWorldVerts (sprite) {
let local = this._local;
let world = this._renderData.vDatas[0];
let floatsPerVert = this.floatsPerVert, offset = 0;
for (let i = 0, j = 0, l = local.length/2; i < l; i++, offset += floatsPerVert) {
j = i * 2;
world[offset] = local[j];
world[offset+1] = local[j+1];
world[offset+2] = 0;
}
}
})
})()

View File

@@ -0,0 +1,19 @@
(function(){
if(!cc.Sprite.__assembler__.RadialFilled3D) return;
let proto = cc.Sprite.__assembler__.RadialFilled3D.prototype;
Object.assign(proto, {
updateWorldVerts (sprite) {
let local = this._local;
let world = this._renderData.vDatas[0];
let floatsPerVert = this.floatsPerVert;
for (let offset = 0, l = world.length; offset < l; offset += floatsPerVert) {
world[offset] = local[offset];
world[offset+1] = local[offset+1];
world[offset+2] = 0;
}
}
})
})()

View File

@@ -0,0 +1,10 @@
(function(){
if(!cc.Sprite.__assembler__.Simple3D) return;
let proto = cc.Sprite.__assembler__.Simple3D.prototype;
let nativeProto = renderer.SimpleSprite3D.prototype;
Object.assign(proto, {
_extendNative: nativeProto.ctor
})
})()

View File

@@ -0,0 +1,10 @@
(function(){
if(!cc.Sprite.__assembler__.Sliced3D) return;
let proto = cc.Sprite.__assembler__.Sliced3D.prototype;
let nativeProto = renderer.SlicedSprite3D.prototype;
Object.assign(proto, {
_extendNative: nativeProto.ctor
})
})()

View File

@@ -0,0 +1,49 @@
(function(){
if(!cc.Sprite.__assembler__.Tiled3D) return;
let proto = cc.Sprite.__assembler__.Tiled3D.prototype;
Object.assign(proto, {
updateWorldVerts (sprite) {
let local = this._local;
let localX = local.x, localY = local.y;
let world = this._renderData.vDatas[0];
let { row, col } = this;
let x, x1, y, y1;
let vertexOffset = 0;
for (let yindex = 0, ylength = row; yindex < ylength; ++yindex) {
y = localY[yindex];
y1 = localY[yindex + 1];
for (let xindex = 0, xlength = col; xindex < xlength; ++xindex) {
x = localX[xindex];
x1 = localX[xindex + 1];
// left bottom
let padding = 6;
world[vertexOffset] = x;
world[vertexOffset + 1] = y;
world[vertexOffset + 2] = 0;
vertexOffset += padding;
// right bottom
world[vertexOffset] = x1;
world[vertexOffset + 1] = y;
world[vertexOffset + 2] = 0;
vertexOffset += padding;
// left top
world[vertexOffset] = x;
world[vertexOffset + 1] = y1;
world[vertexOffset + 2] = 0;
vertexOffset += padding;
// right top
world[vertexOffset] = x1;
world[vertexOffset + 1] = y1;
world[vertexOffset + 2] = 0;
vertexOffset += padding;
}
}
}
})
})()