Skip to content

Commit 3a3b206

Browse files
committed
fix(Texture): adjust decls and fix incorrect usage of delete[]
1 parent 05091d4 commit 3a3b206

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/zenkit-capi/Texture.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ using ZkTexture = zenkit::Texture;
1111
using ZkTextureBuilder = zenkit::TextureBuilder;
1212
#else
1313
typedef struct ZkInternal_Texture ZkTexture;
14+
typedef struct ZkInternal_TextureBuilder ZkTextureBuilder;
1415
#endif
1516

1617
typedef enum {
@@ -61,5 +62,5 @@ ZKC_API void ZkTexture_enumerateRgbaMipmaps(ZkTexture const* slf, ZkTextureMipma
6162
ZKC_API ZkTextureBuilder* ZkTextureBuilder_new(ZkSize width, ZkSize height);
6263
ZKC_API void ZkTextureBuilder_del(ZkTextureBuilder* slf);
6364

64-
ZKC_API bool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt);
65+
ZKC_API ZkBool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt);
6566
ZKC_API ZkTexture* ZkTextureBuilder_build(ZkTextureBuilder* slf, ZkTextureFormat fmt);

src/Texture.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,14 @@ void ZkTexture_enumerateRgbaMipmaps(ZkTexture const* slf, ZkTextureMipmapEnumera
132132

133133
ZkTextureBuilder* ZkTextureBuilder_new(ZkSize width, ZkSize height) {
134134
ZKC_TRACE_FN();
135-
136135
return new ZkTextureBuilder {static_cast<unsigned int>(width), static_cast<unsigned int>(height)};
137136
}
138137

139138
void ZkTextureBuilder_del(ZkTextureBuilder* slf) {
140-
delete[] slf;
139+
delete slf;
141140
}
142141

143-
bool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt) {
142+
ZkBool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt) {
144143
ZKC_TRACE_FN();
145144
ZKC_CHECK_NULL(slf, buf);
146145

0 commit comments

Comments
 (0)