mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-31 11:12:35 +01:00
cleaned AvatarImageBodyPartContainer
This commit is contained in:
parent
4e54c91554
commit
a8f7893248
@ -358,17 +358,17 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
isCachable = ((isCachable) && (part._Str_1807));
|
isCachable = ((isCachable) && (part.isCacheable));
|
||||||
|
|
||||||
const point = part._Str_1076.clone();
|
const point = part.regPoint.clone();
|
||||||
|
|
||||||
if(point)
|
if(point)
|
||||||
{
|
{
|
||||||
point.x += avatarCanvas.offset.x;
|
point.x += avatarCanvas.offset.x;
|
||||||
point.y += avatarCanvas.offset.y;
|
point.y += avatarCanvas.offset.y;
|
||||||
|
|
||||||
point.x += avatarCanvas._Str_1076.x;
|
point.x += avatarCanvas.regPoint.x;
|
||||||
point.y += avatarCanvas._Str_1076.y;
|
point.y += avatarCanvas.regPoint.y;
|
||||||
|
|
||||||
const partContainer = new Container();
|
const partContainer = new Container();
|
||||||
|
|
||||||
@ -477,15 +477,15 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const point = part._Str_1076.clone();
|
const point = part.regPoint.clone();
|
||||||
|
|
||||||
if(point)
|
if(point)
|
||||||
{
|
{
|
||||||
point.x += avatarCanvas.offset.x;
|
point.x += avatarCanvas.offset.x;
|
||||||
point.y += avatarCanvas.offset.y;
|
point.y += avatarCanvas.offset.y;
|
||||||
|
|
||||||
point.x += avatarCanvas._Str_1076.x;
|
point.x += avatarCanvas.regPoint.x;
|
||||||
point.y += avatarCanvas._Str_1076.y;
|
point.y += avatarCanvas.regPoint.y;
|
||||||
|
|
||||||
const partContainer = new Container();
|
const partContainer = new Container();
|
||||||
|
|
||||||
@ -542,15 +542,15 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const point = part._Str_1076.clone();
|
const point = part.regPoint.clone();
|
||||||
|
|
||||||
if(point)
|
if(point)
|
||||||
{
|
{
|
||||||
point.x += avatarCanvas.offset.x;
|
point.x += avatarCanvas.offset.x;
|
||||||
point.y += avatarCanvas.offset.y;
|
point.y += avatarCanvas.offset.y;
|
||||||
|
|
||||||
point.x += avatarCanvas._Str_1076.x;
|
point.x += avatarCanvas.regPoint.x;
|
||||||
point.y += avatarCanvas._Str_1076.y;
|
point.y += avatarCanvas.regPoint.y;
|
||||||
|
|
||||||
const partContainer = new Container();
|
const partContainer = new Container();
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ export class AvatarImageBodyPartContainer
|
|||||||
this._regPoint = _arg_2;
|
this._regPoint = _arg_2;
|
||||||
this._isCacheable = _arg_3;
|
this._isCacheable = _arg_3;
|
||||||
|
|
||||||
this._Str_1225();
|
this.cleanPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void
|
public dispose(): void
|
||||||
@ -32,7 +32,7 @@ export class AvatarImageBodyPartContainer
|
|||||||
this._offset = null;
|
this._offset = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _Str_1225(): void
|
private cleanPoints(): void
|
||||||
{
|
{
|
||||||
// this._regPoint.x = this._regPoint.x;
|
// this._regPoint.x = this._regPoint.x;
|
||||||
// this._regPoint.y = this._regPoint.y;
|
// this._regPoint.y = this._regPoint.y;
|
||||||
@ -40,11 +40,11 @@ export class AvatarImageBodyPartContainer
|
|||||||
// this._offset.y = this._offset.y;
|
// this._offset.y = this._offset.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public _Str_1387(k: Point): void
|
public setRegPoint(k: Point): void
|
||||||
{
|
{
|
||||||
this._regPoint = k;
|
this._regPoint = k;
|
||||||
|
|
||||||
this._Str_1225();
|
this.cleanPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
public get image(): Container
|
public get image(): Container
|
||||||
@ -64,7 +64,7 @@ export class AvatarImageBodyPartContainer
|
|||||||
this._image = k;
|
this._image = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get _Str_1076(): Point
|
public get regPoint(): Point
|
||||||
{
|
{
|
||||||
const clone = this._regPoint.clone();
|
const clone = this._regPoint.clone();
|
||||||
|
|
||||||
@ -78,11 +78,11 @@ export class AvatarImageBodyPartContainer
|
|||||||
{
|
{
|
||||||
this._offset = k;
|
this._offset = k;
|
||||||
|
|
||||||
this._Str_1225();
|
this.cleanPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
public get _Str_1807(): boolean
|
public get isCacheable(): boolean
|
||||||
{
|
{
|
||||||
return this._isCacheable;
|
return this._isCacheable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
src/nitro/avatar/cache/AvatarImageCache.ts
vendored
8
src/nitro/avatar/cache/AvatarImageCache.ts
vendored
@ -280,7 +280,7 @@ export class AvatarImageCache
|
|||||||
|
|
||||||
if(_local_14 && !_arg_3)
|
if(_local_14 && !_arg_3)
|
||||||
{
|
{
|
||||||
if(_local_14._Str_1807) _local_13._Str_1924(_local_14, frameCount);
|
if(_local_14.isCacheable) _local_13._Str_1924(_local_14, frameCount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -443,7 +443,7 @@ export class AvatarImageCache
|
|||||||
|
|
||||||
const imageData = this._Str_1236(this._unionImages, isFlipped);
|
const imageData = this._Str_1236(this._unionImages, isFlipped);
|
||||||
const canvasOffset = ((this._scale === AvatarScaleType.LARGE) ? (this._canvas.height - 16) : (this._canvas.height - 8));
|
const canvasOffset = ((this._scale === AvatarScaleType.LARGE) ? (this._canvas.height - 16) : (this._canvas.height - 8));
|
||||||
const offset = new Point(-(imageData._Str_1076.x), (canvasOffset - imageData._Str_1076.y));
|
const offset = new Point(-(imageData.regPoint.x), (canvasOffset - imageData.regPoint.y));
|
||||||
|
|
||||||
if(isFlipped && (assetPartDefinition !== 'lay')) offset.x = (offset.x + ((this._scale === AvatarScaleType.LARGE) ? 67 : 31));
|
if(isFlipped && (assetPartDefinition !== 'lay')) offset.x = (offset.x + ((this._scale === AvatarScaleType.LARGE) ? 67 : 31));
|
||||||
|
|
||||||
@ -496,8 +496,8 @@ export class AvatarImageCache
|
|||||||
const flipH = (!(isFlipped && data.flipH) && (isFlipped || data.flipH));
|
const flipH = (!(isFlipped && data.flipH) && (isFlipped || data.flipH));
|
||||||
const regPoint = point.clone();
|
const regPoint = point.clone();
|
||||||
|
|
||||||
regPoint.x -= data._Str_1076.x;
|
regPoint.x -= data.regPoint.x;
|
||||||
regPoint.y -= data._Str_1076.y;
|
regPoint.y -= data.regPoint.y;
|
||||||
|
|
||||||
if(isFlipped) regPoint.x = (container.width - (regPoint.x + data.rect.width));
|
if(isFlipped) regPoint.x = (container.width - (regPoint.x + data.rect.width));
|
||||||
|
|
||||||
|
4
src/nitro/avatar/cache/ImageData.ts
vendored
4
src/nitro/avatar/cache/ImageData.ts
vendored
@ -43,7 +43,7 @@ export class ImageData
|
|||||||
return this._rect;
|
return this._rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get _Str_1076(): Point
|
public get regPoint(): Point
|
||||||
{
|
{
|
||||||
return this._regPoint;
|
return this._regPoint;
|
||||||
}
|
}
|
||||||
@ -62,4 +62,4 @@ export class ImageData
|
|||||||
{
|
{
|
||||||
return new Rectangle(-(this._regPoint.x), -(this._regPoint.y), this._rect.width, this._rect.height);
|
return new Rectangle(-(this._regPoint.x), -(this._regPoint.y), this._rect.width, this._rect.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@ export class AvatarCanvas
|
|||||||
return this._id;
|
return this._id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get _Str_1076(): Point
|
public get regPoint(): Point
|
||||||
{
|
{
|
||||||
return this._regPoint;
|
return this._regPoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user