fix: little endian pvr

This commit is contained in:
TrèsAbhi committed 2023-12-30 11:44:42 -06:00
1 parent fa625dc887
commit 21daf9f3bb
5 files changed
+15 -6

No files matched your search

-2
View File
@@ -177,8 +177,6 @@ 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:
+4 -4
View File
@@ -119,10 +119,10 @@ export class PvrStream extends BufferStream {
times(pixelCount, (index) => {
const buffer = this.consume(2);
const bufferIndex = index * 4;
const r = ((buffer[0] & 0b11110000) >>> 4) / 15;
const g = (buffer[0] & 0b1111) / 15;
const b = ((buffer[1] & 0b11110000) >>> 4) / 15;
const a = (buffer[1] & 0b1111) / 15;
const r = ((buffer[1] & 0b11110000) >>> 4) / 15;
const g = (buffer[1] & 0b1111) / 15;
const b = ((buffer[0] & 0b11110000) >>> 4) / 15;
const a = (buffer[0] & 0b1111) / 15;
data[bufferIndex] = Math.round(clamp(r * 255, 0, 255));
data[bufferIndex + 1] = Math.round(clamp(g * 255, 0, 255));