From a16c3c758047cf7a53be465c2546c23624424e64 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 10 Mar 2025 22:22:07 +0800 Subject: [PATCH] add logging to setImage --- thermion_dart/native/src/c_api/TTexture.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/thermion_dart/native/src/c_api/TTexture.cpp b/thermion_dart/native/src/c_api/TTexture.cpp index 2612e793..13ad1670 100644 --- a/thermion_dart/native/src/c_api/TTexture.cpp +++ b/thermion_dart/native/src/c_api/TTexture.cpp @@ -199,20 +199,25 @@ namespace thermion { case PixelBufferDescriptor::PixelDataFormat::RGB: case PixelBufferDescriptor::PixelDataFormat::RGBA: - if (size != width * height * channels * sizeof(float)) + { + size_t expectedSize = width * height * channels * sizeof(float); + if (size != expectedSize) { - Log("Size mismatch"); + Log("Size mismatch (expected %d, got %d)", expectedSize, size); return false; } break; + } case PixelBufferDescriptor::PixelDataFormat::RGB_INTEGER: case PixelBufferDescriptor::PixelDataFormat::RGBA_INTEGER: + { if (size != width * height * channels * sizeof(uint8_t)) { Log("Size mismatch"); // return false; } break; + } default: Log("Unsupported buffer format type : %d", bufferFormat); return false;