Skip to content

Commit

Permalink
Remove useless code (#15670)
Browse files Browse the repository at this point in the history
* remove unused data

* refine
  • Loading branch information
SantyWang authored Jul 11, 2023
1 parent 09f83b4 commit ddc19f1
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions cocos/2d/renderer/render-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class RenderData extends BaseRenderData {
this.syncRender2dBuffer();
}

get data ():IRenderData[] {
get data (): IRenderData[] {
return this._data;
}

Expand Down Expand Up @@ -304,10 +304,6 @@ export class RenderData extends BaseRenderData {
public hashDirty = true;

private _data: IRenderData[] = [];
private _pivotX = 0;
private _pivotY = 0;
private _width = 0;
private _height = 0;
private _frame: SpriteFrame | TextureBase | null = null;
protected _accessor: StaticVBAccessor = null!;
get accessor (): StaticVBAccessor { return this._accessor; }
Expand Down Expand Up @@ -495,26 +491,9 @@ export class RenderData extends BaseRenderData {
}
}

public updateSizeNPivot (width: number, height: number, pivotX: number, pivotY: number): void {
if (width !== this._width
|| height !== this._height
|| pivotX !== this._pivotX
|| pivotY !== this._pivotY) {
this._width = width;
this._height = height;
this._pivotX = pivotX;
this._pivotY = pivotY;
this.vertDirty = true;
}
}

public clear (): void {
this.resize(0, 0);
this._data.length = 0;
this._pivotX = 0;
this._pivotY = 0;
this._width = 0;
this._height = 0;
this.indices = null;
this.vertDirty = true;
this.material = null;
Expand Down Expand Up @@ -810,5 +789,3 @@ export class MeshRenderData extends BaseRenderData {
}
}
}

const _meshDataPool: RecyclePool<MeshRenderData> = new RecyclePool(() => new MeshRenderData(), 32);

0 comments on commit ddc19f1

Please sign in to comment.