Skip to content

Commit

Permalink
fix(Texture): adjust decls and fix incorrect usage of delete[]
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Oct 27, 2024
1 parent 05091d4 commit 3a3b206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/zenkit-capi/Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using ZkTexture = zenkit::Texture;
using ZkTextureBuilder = zenkit::TextureBuilder;
#else
typedef struct ZkInternal_Texture ZkTexture;
typedef struct ZkInternal_TextureBuilder ZkTextureBuilder;
#endif

typedef enum {
Expand Down Expand Up @@ -61,5 +62,5 @@ ZKC_API void ZkTexture_enumerateRgbaMipmaps(ZkTexture const* slf, ZkTextureMipma
ZKC_API ZkTextureBuilder* ZkTextureBuilder_new(ZkSize width, ZkSize height);
ZKC_API void ZkTextureBuilder_del(ZkTextureBuilder* slf);

ZKC_API bool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt);
ZKC_API ZkBool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt);
ZKC_API ZkTexture* ZkTextureBuilder_build(ZkTextureBuilder* slf, ZkTextureFormat fmt);
5 changes: 2 additions & 3 deletions src/Texture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ void ZkTexture_enumerateRgbaMipmaps(ZkTexture const* slf, ZkTextureMipmapEnumera

ZkTextureBuilder* ZkTextureBuilder_new(ZkSize width, ZkSize height) {
ZKC_TRACE_FN();

return new ZkTextureBuilder {static_cast<unsigned int>(width), static_cast<unsigned int>(height)};
}

void ZkTextureBuilder_del(ZkTextureBuilder* slf) {
delete[] slf;
delete slf;
}

bool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt) {
ZkBool ZkTextureBuilder_addMipmap(ZkTextureBuilder* slf, ZkByte* buf, ZkSize len, ZkTextureFormat fmt) {
ZKC_TRACE_FN();
ZKC_CHECK_NULL(slf, buf);

Expand Down

0 comments on commit 3a3b206

Please sign in to comment.