You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 15:36:18 +00:00
🆙 Update IGetImageListener
This commit is contained in:
@@ -4,9 +4,11 @@ import { Texture } from 'pixi.js';
|
||||
|
||||
export class ImageResult implements IImageResult
|
||||
{
|
||||
public id: number = 0;
|
||||
public data: Texture = null;
|
||||
public image: HTMLImageElement = null;
|
||||
constructor(
|
||||
public id: number = 0,
|
||||
public data: Texture = null,
|
||||
public image: HTMLImageElement = null)
|
||||
{}
|
||||
|
||||
public async getImage(): Promise<HTMLImageElement>
|
||||
{
|
||||
@@ -16,4 +18,4 @@ export class ImageResult implements IImageResult
|
||||
|
||||
return await TextureUtils.generateImage(this.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2519,7 +2519,7 @@ export class RoomEngine implements IRoomEngine, IRoomCreator, IRoomEngineService
|
||||
{
|
||||
if(!listener) continue;
|
||||
|
||||
listener.imageReady(id, null, image);
|
||||
listener.imageReady(new ImageResult(id, null, image));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2980,7 +2980,7 @@ export class RoomEngine implements IRoomEngine, IRoomCreator, IRoomEngineService
|
||||
{
|
||||
if(!imageListener) continue;
|
||||
|
||||
if(texture) imageListener.imageReady(objectId, texture);
|
||||
if(texture) imageListener.imageReady(new ImageResult(objectId, texture));
|
||||
else imageListener.imageFailed(objectId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user