You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
🆙 Place back Mem optimizing and Username to badge send
This commit is contained in:
@@ -315,6 +315,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
|||||||
|
|
||||||
const url = canvas.toDataURL('image/png');
|
const url = canvas.toDataURL('image/png');
|
||||||
|
|
||||||
|
canvas.width = 0;
|
||||||
|
canvas.height = 0;
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
@@ -23,6 +23,12 @@ export class ImageData
|
|||||||
|
|
||||||
public dispose(): void
|
public dispose(): void
|
||||||
{
|
{
|
||||||
|
if(this._container)
|
||||||
|
{
|
||||||
|
this._container.destroy({ children: true });
|
||||||
|
this._container = null;
|
||||||
|
}
|
||||||
|
|
||||||
this._texture = null;
|
this._texture = null;
|
||||||
this._regPoint = null;
|
this._regPoint = null;
|
||||||
this._colorTransform = null;
|
this._colorTransform = null;
|
||||||
|
|||||||
@@ -117,7 +117,12 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager
|
|||||||
|
|
||||||
TextureUtils.writeToTexture(container, renderTexture);
|
TextureUtils.writeToTexture(container, renderTexture);
|
||||||
|
|
||||||
return await TextureUtils.generateImage(renderTexture);
|
const image = await TextureUtils.generateImage(renderTexture);
|
||||||
|
|
||||||
|
renderTexture.destroy(true);
|
||||||
|
container.destroy({ children: true });
|
||||||
|
|
||||||
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get effects(): Map<string, IRoomCameraWidgetEffect>
|
public get effects(): Map<string, IRoomCameraWidgetEffect>
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||||
|
|
||||||
export class BadgeReceivedParser implements IMessageParser
|
export class BadgeReceivedParser implements IMessageParser
|
||||||
{
|
{
|
||||||
private _badgeId: number;
|
private _badgeId: number;
|
||||||
private _badgeCode: string;
|
private _badgeCode: string;
|
||||||
|
private _senderName: string;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
this._badgeId = 0;
|
this._badgeId = 0;
|
||||||
this._badgeCode = null;
|
this._badgeCode = null;
|
||||||
|
this._senderName = '';
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -19,6 +21,7 @@ export class BadgeReceivedParser implements IMessageParser
|
|||||||
|
|
||||||
this._badgeId = wrapper.readInt();
|
this._badgeId = wrapper.readInt();
|
||||||
this._badgeCode = wrapper.readString();
|
this._badgeCode = wrapper.readString();
|
||||||
|
this._senderName = wrapper.bytesAvailable ? wrapper.readString() : '';
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -32,4 +35,9 @@ export class BadgeReceivedParser implements IMessageParser
|
|||||||
{
|
{
|
||||||
return this._badgeCode;
|
return this._badgeCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get senderName(): string
|
||||||
|
{
|
||||||
|
return this._senderName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -239,6 +239,8 @@ export class RoomPreviewer
|
|||||||
|
|
||||||
if(this.isRoomEngineReady)
|
if(this.isRoomEngineReady)
|
||||||
{
|
{
|
||||||
|
if((this._currentPreviewObjectCategory === RoomObjectCategory.FLOOR) && (this._currentPreviewObjectType === classId) && (this._currentPreviewObjectData === (extra || ''))) return RoomPreviewer.PREVIEW_OBJECT_ID;
|
||||||
|
|
||||||
this.reset(false);
|
this.reset(false);
|
||||||
|
|
||||||
this._currentPreviewObjectType = classId;
|
this._currentPreviewObjectType = classId;
|
||||||
|
|||||||
@@ -164,6 +164,18 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
|
|||||||
|
|
||||||
if(this._avatarImage) this._avatarImage.dispose();
|
if(this._avatarImage) this._avatarImage.dispose();
|
||||||
|
|
||||||
|
if(this._cachedAvatars)
|
||||||
|
{
|
||||||
|
for(const avatar of this._cachedAvatars.getValues()) avatar && avatar.dispose();
|
||||||
|
this._cachedAvatars.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this._cachedAvatarEffects)
|
||||||
|
{
|
||||||
|
for(const avatar of this._cachedAvatarEffects.getValues()) avatar && avatar.dispose();
|
||||||
|
this._cachedAvatarEffects.reset();
|
||||||
|
}
|
||||||
|
|
||||||
if(this._reflectionOppositeTexture)
|
if(this._reflectionOppositeTexture)
|
||||||
{
|
{
|
||||||
this._reflectionOppositeTexture.destroy(true);
|
this._reflectionOppositeTexture.destroy(true);
|
||||||
|
|||||||
@@ -27,6 +27,17 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
|
|||||||
this._photoUrl = null;
|
this._photoUrl = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public dispose(): void {
|
||||||
|
if (this._thumbnailTexture instanceof RenderTexture) {
|
||||||
|
this._thumbnailTexture.destroy(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._thumbnailTexture = null;
|
||||||
|
this._thumbnailImageNormal = null;
|
||||||
|
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
public get hasThumbnailImage(): boolean {
|
public get hasThumbnailImage(): boolean {
|
||||||
return !(this._thumbnailImageNormal == null);
|
return !(this._thumbnailImageNormal == null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,6 +158,16 @@ export class RoomPlane implements IRoomPlane
|
|||||||
this._animationLayers = [];
|
this._animationLayers = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._windowReflectionLastVisible.clear();
|
||||||
|
this._windowReflectionFadeOut.clear();
|
||||||
|
this._windowReflectionFirstSeenAt.clear();
|
||||||
|
|
||||||
|
if(this._maskFilter)
|
||||||
|
{
|
||||||
|
this._maskFilter.destroy();
|
||||||
|
this._maskFilter = null;
|
||||||
|
}
|
||||||
|
|
||||||
this._disposed = true;
|
this._disposed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user