From fa625dc887f5052cc45353421b02f3e5ef875fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Fri, 29 Dec 2023 19:59:01 -0600 Subject: [PATCH] fix: bc1 alpha check --- src/core/streams/dds.ts | 4 +++- src/core/streams/pvr.ts | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/streams/dds.ts b/src/core/streams/dds.ts index 4c19a8c61..f4604159c 100644 --- a/src/core/streams/dds.ts +++ b/src/core/streams/dds.ts @@ -177,6 +177,8 @@ export class DdsStream extends WindowsStream { const header = this.header(); const dxgiFormat = this.resolveDxgiFormat(header); + console.log(DxgiFormat[dxgiFormat]); + switch (dxgiFormat) { case DxgiFormat.BC1_TYPELESS: case DxgiFormat.BC1_UNORM: @@ -350,7 +352,7 @@ export class DdsStream extends WindowsStream { const color0 = this.R5G6B5A0(); const int1 = this.readR5G6B5Int(); const color1 = this.R5G6B5A0(); - const alpha = int0 > int1; + const alpha = int0 < int1; const color2 = alpha ? (color0.map( (channel0, index) => (channel0 + color1[index]) / 2, diff --git a/src/core/streams/pvr.ts b/src/core/streams/pvr.ts index 8b2eba4f3..6d99c4f85 100644 --- a/src/core/streams/pvr.ts +++ b/src/core/streams/pvr.ts @@ -96,8 +96,6 @@ export class PvrStream extends BufferStream { const header = this.header(); const metadata = this.metadata(); - console.log(header, metadata); - if (typeof header.pixelFormat === 'number') { switch (header.pixelFormat) { default: