mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix: little endian pvr
This commit is contained in:
1 parent
fa625dc887
commit
21daf9f3bb
5 files changed
+15
-6
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user