Skip to content

Commit f2580d5

Browse files
committed
style: normalize GlDriver compressed-format indentation
1 parent 71ec7bf commit f2580d5

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

h3d/impl/GlDriver.hx

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,38 +1143,38 @@ class GlDriver extends Driver {
11431143
tt.internalFmt = GL.R11F_G11F_B10F;
11441144
tt.pixelFmt = GL.UNSIGNED_INT_10F_11F_11F_REV;
11451145
case S3TC(n) if( n <= maxCompressedTexturesSupport ):
1146-
if( t.width&3 != 0 || t.height&3 != 0 )
1147-
throw "Compressed texture "+t+" has size "+t.width+"x"+t.height+" - must be a multiple of 4";
1148-
switch( n ) {
1149-
case 1: tt.internalFmt = 0x83F1; // COMPRESSED_RGBA_S3TC_DXT1_EXT
1150-
case 2: tt.internalFmt = 0x83F2; // COMPRESSED_RGBA_S3TC_DXT3_EXT
1151-
case 3: tt.internalFmt = 0x83F3; // COMPRESSED_RGBA_S3TC_DXT5_EXT
1152-
case 6: tt.internalFmt = 0x8E8F; // COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT
1153-
case 7: tt.internalFmt = 0x8E8C; // COMPRESSED_RGBA_BPTC_UNORM
1154-
default: throw "Unsupported texture format "+t.format;
1155-
}
1146+
if( t.width&3 != 0 || t.height&3 != 0 )
1147+
throw "Compressed texture "+t+" has size "+t.width+"x"+t.height+" - must be a multiple of 4";
1148+
switch( n ) {
1149+
case 1: tt.internalFmt = 0x83F1; // COMPRESSED_RGBA_S3TC_DXT1_EXT
1150+
case 2: tt.internalFmt = 0x83F2; // COMPRESSED_RGBA_S3TC_DXT3_EXT
1151+
case 3: tt.internalFmt = 0x83F3; // COMPRESSED_RGBA_S3TC_DXT5_EXT
1152+
case 6: tt.internalFmt = 0x8E8F; // COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT
1153+
case 7: tt.internalFmt = 0x8E8C; // COMPRESSED_RGBA_BPTC_UNORM
1154+
default: throw "Unsupported texture format "+t.format;
1155+
}
11561156
case ASTC(n):
1157-
if( t.width&3 != 0 || t.height&3 != 0 )
1158-
throw "Compressed texture "+t+" has size "+t.width+"x"+t.height+" - must be a multiple of 4";
1159-
switch( n ) {
1160-
case 10: tt.internalFmt = 0x93B0; // COMPRESSED_RGBA_ASTC_4x4_KHR
1161-
default: throw "Unsupported texture format "+t.format;
1162-
}
1157+
if( t.width&3 != 0 || t.height&3 != 0 )
1158+
throw "Compressed texture "+t+" has size "+t.width+"x"+t.height+" - must be a multiple of 4";
1159+
switch( n ) {
1160+
case 10: tt.internalFmt = 0x93B0; // COMPRESSED_RGBA_ASTC_4x4_KHR
1161+
default: throw "Unsupported texture format "+t.format;
1162+
}
11631163
case ETC(n):
1164-
if( t.width&3 != 0 || t.height&3 != 0 )
1165-
throw "Compressed texture "+t+" has size "+t.width+"x"+t.height+" - must be a multiple of 4";
1166-
switch( n ) {
1167-
case 0:
1168-
#if js
1169-
// WEBGL_compressed_texture_etc1 is not available in WebGL2; use ETC2 RGB8 fallback.
1170-
if( textureSupport != null && !textureSupport.etc1 && textureSupport.etc2 )
1171-
tt.internalFmt = 0x9274; // ETC2 RGB8
1172-
else
1173-
#end
1174-
tt.internalFmt = 0x8D64; // ETC1
1175-
case 1, 2: tt.internalFmt = 0x9278; // ETC2 RGBA8
1176-
default: throw "Unsupported texture format "+t.format;
1177-
}
1164+
if( t.width&3 != 0 || t.height&3 != 0 )
1165+
throw "Compressed texture "+t+" has size "+t.width+"x"+t.height+" - must be a multiple of 4";
1166+
switch( n ) {
1167+
case 0:
1168+
#if js
1169+
// WEBGL_compressed_texture_etc1 is not available in WebGL2; use ETC2 RGB8 fallback.
1170+
if( textureSupport != null && !textureSupport.etc1 && textureSupport.etc2 )
1171+
tt.internalFmt = 0x9274; // ETC2 RGB8
1172+
else
1173+
#end
1174+
tt.internalFmt = 0x8D64; // ETC1
1175+
case 1, 2: tt.internalFmt = 0x9278; // ETC2 RGBA8
1176+
default: throw "Unsupported texture format "+t.format;
1177+
}
11781178
default:
11791179
throw "Unsupported texture format "+t.format;
11801180
}

0 commit comments

Comments
 (0)