Skip to content

Commit

Permalink
Remove image.hpp dependency (#542)
Browse files Browse the repository at this point in the history
* Remove image.hpp dependency

* Fix memset warning

Co-authored-by: Wasim Abbas <[email protected]>
  • Loading branch information
wasimabbas-arm and abbaswasim authored Mar 4, 2022
1 parent cb45ead commit 9fde96b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/astc_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <zstd.h>
#include <KHR/khr_df.h>

Expand All @@ -32,7 +33,6 @@
#include "vk_format.h"

#include "astc-encoder/Source/astcenc.h"
#include "../tools/toktx/image.hpp"

// Provide pthreads support on windows
#if defined(_WIN32) && !defined(__CYGWIN__)
Expand Down
5 changes: 4 additions & 1 deletion tools/toktx/image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,10 @@ class ImageT : public Image {
pixels = (Color*)malloc(bytes);
if (!pixels)
throw std::bad_alloc();
memset(pixels, 0, bytes);

for (uint32_t b = 0; b < w * h; ++b)
for(uint32_t c = 0; c < componentCount; ++c)
memset(&pixels[b].comps[c], 0, sizeof(componentType));
}

ImageT(uint32_t w, uint32_t h, Color* pixels) : Image(w, h), pixels(pixels)
Expand Down

0 comments on commit 9fde96b

Please sign in to comment.