mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-10-30 02:42:57 +08:00
chore: 贴图裁剪范围检查
This commit is contained in:
parent
1087de639d
commit
ce7be406cb
@ -106,6 +106,9 @@
|
|||||||
"72": "Frame count delivered to frame-based animater need to exactly divide texture's height.",
|
"72": "Frame count delivered to frame-based animater need to exactly divide texture's height.",
|
||||||
"73": "Consistent size is needed when using WebGL2 composer.",
|
"73": "Consistent size is needed when using WebGL2 composer.",
|
||||||
"74": "Frame size not match texture's size, incomplete data will be skipped.",
|
"74": "Frame size not match texture's size, incomplete data will be skipped.",
|
||||||
|
"75": "Material count splitted by grid does not match alias count, some material may have no alias or some alias may not map to a texture. Splitted: $1, alias: $2.",
|
||||||
|
"76": "Cannot pipe texture store when asset builder is started.",
|
||||||
|
"77": "Texture is clipped to an area of 0. Ensure that the texture contains your clip rect and clip rect's area is not zero.",
|
||||||
"1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency.",
|
"1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency.",
|
||||||
"1101": "Cannot add new effect to point effect instance, for there's no more reserve space for it. Please increase the max count of the instance."
|
"1101": "Cannot add new effect to point effect instance, for there's no more reserve space for it. Please increase the max count of the instance."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,6 +53,12 @@ export class Texture<T = unknown, A = unknown> implements ITexture<T, A> {
|
|||||||
const top = Math.max(0, y);
|
const top = Math.max(0, y);
|
||||||
const right = Math.min(this.width, r);
|
const right = Math.min(this.width, r);
|
||||||
const bottom = Math.min(this.height, b);
|
const bottom = Math.min(this.height, b);
|
||||||
|
const width = right - left;
|
||||||
|
const height = bottom - top;
|
||||||
|
if (width <= 0 || height <= 0) {
|
||||||
|
logger.warn(77);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.cl = left;
|
this.cl = left;
|
||||||
this.ct = top;
|
this.ct = top;
|
||||||
this.width = right - left;
|
this.width = right - left;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user