Skip to content

Commit 1adee72

Browse files
committed
cleanup
1 parent 3641163 commit 1adee72

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

code/graphics/opengl/gropengltexture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "math/vecmat.h"
2525
#include "options/Option.h"
2626
#include "osapi/osregistry.h"
27-
#include <ktxutils/ktxutils.h>
27+
#include "ktxutils/ktxutils.h"
2828
matrix4 GL_texture_matrix;
2929

3030
int GL_texture_ram = 0;
@@ -450,7 +450,7 @@ static int opengl_texture_set_level(int bitmap_handle, int bitmap_type, int bmap
450450
case KTX_ETC2_RGB_A1:
451451
case KTX_ETC2_SRGB_A1:
452452
intFormat = ktx_map_ktx_format_to_gl_internal(bm_handle);
453-
block_size = ktx_etc_block_bytes(intFormat);
453+
block_size = ktx_etc_block_size(intFormat);
454454
break;
455455
}
456456

code/ktxutils/ktxutils.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
static const uint8_t KTX_ID[12] = { 0xAB, 'K', 'T', 'X', ' ', '1', '1', 0xBB, '\r', '\n', 0x1A, '\n' };
1515

16-
// BPB ETC/EAC
17-
uint32_t ktx_etc_block_bytes(const int internal_format)
16+
uint32_t ktx_etc_block_size(const int internal_format)
1817
{
1918
switch (internal_format)
2019
{
@@ -33,7 +32,6 @@ uint32_t ktx_etc_block_bytes(const int internal_format)
3332
}
3433
}
3534

36-
3735
int ktx_map_ktx_format_to_gl_internal(const int ktx_format)
3836
{
3937
switch (ktx_format)
@@ -55,7 +53,7 @@ int ktx_map_ktx_format_to_gl_internal(const int ktx_format)
5553
}
5654
}
5755

58-
int ktx_map_gl_internal_to_bm(const int internal_format)
56+
int ktx_map_gl_internal_to_bm_type(const int internal_format)
5957
{
6058
switch (internal_format)
6159
{
@@ -140,8 +138,8 @@ int ktx1_read_header(const char* filename, CFILE* img_cfp, int* w, int* h, int*
140138
}
141139

142140
const uint32_t fmt = hdr.glInternalFormat;
143-
const uint32_t blockBytes = ktx_etc_block_bytes(fmt);
144-
const int bm_ct = ktx_map_gl_internal_to_bm(fmt);
141+
const uint32_t blockBytes = ktx_etc_block_size(fmt);
142+
const int bm_ct = ktx_map_gl_internal_to_bm_type(fmt);
145143
if (blockBytes == 0 || bm_ct == BM_TYPE_NONE) {
146144
if (!img_cfp)
147145
cfclose(cf);

code/ktxutils/ktxutils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "globalincs/pstypes.h"
33
#include "cfile/cfile.h"
44
#ifdef WITH_OPENGL
5-
#include <glad/glad.h>
5+
#include "glad/glad.h"
66
#endif
77

88
// ETC2 types
@@ -69,5 +69,5 @@ int ktx1_read_bitmap(const char* filename, ubyte* dst, ubyte* out_bpp);
6969
//Get the GL enum type for this KTX format type, returns 0 if type is invalid.
7070
int ktx_map_ktx_format_to_gl_internal(const int ktx_format);
7171

72-
//Get ktx bits per byte from GL internat format enum, returns 0 if internal format is invalid
73-
uint32_t ktx_etc_block_bytes(const int internal_format);
72+
//Get ktx block size (bytes per block) from GL internat format enum, returns 0 if internal format is invalid
73+
uint32_t ktx_etc_block_size(const int internal_format);

0 commit comments

Comments
 (0)