mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
build: Update for software defined 128 bit types
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
namespace hex::plugin::visualizers {
|
||||
std::vector<u32> getIndices(pl::ptrn::Pattern *colorTablePattern, u128 width, u128 height);
|
||||
ImGuiExt::Texture getTexture(pl::ptrn::Pattern *colorTablePattern, std::vector<u32>& indices, u128 width, u128 height);
|
||||
std::vector<u32> getIndices(pl::ptrn::Pattern *colorTablePattern, u64 width, u64 height);
|
||||
ImGuiExt::Texture getTexture(pl::ptrn::Pattern *colorTablePattern, std::vector<u32>& indices, u64 width, u64 height);
|
||||
|
||||
|
||||
void drawImageVisualizer(pl::ptrn::Pattern &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
|
||||
@@ -42,8 +42,8 @@ namespace hex::plugin::visualizers {
|
||||
|
||||
if (shouldReset) {
|
||||
auto pattern = arguments[0].toPattern();
|
||||
auto width = arguments[1].toUnsigned();
|
||||
auto height = arguments[2].toUnsigned();
|
||||
auto width = u64(arguments[1].toUnsigned());
|
||||
auto height = u64(arguments[2].toUnsigned());
|
||||
bool hasColorTable = false;
|
||||
|
||||
if (arguments.size() == 4) {
|
||||
@@ -58,7 +58,7 @@ namespace hex::plugin::visualizers {
|
||||
|
||||
if (!hasColorTable) {
|
||||
auto data = pattern->getBytes();
|
||||
texture = ImGuiExt::Texture::fromBitmap(data.data(), data.size(), width, height,ImGuiExt::Texture::Filter::Nearest);
|
||||
texture = ImGuiExt::Texture::fromBitmap(data.data(), data.size(), width, height, ImGuiExt::Texture::Filter::Nearest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace hex::plugin::visualizers {
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T> ImGuiExt::Texture unmapColors(pl::ptrn::Pattern *colorTablePattern, std::vector<u32>& indices, u128 width, u128 height) {
|
||||
template <typename T> ImGuiExt::Texture unmapColors(pl::ptrn::Pattern *colorTablePattern, std::vector<u32>& indices, u64 width, u64 height) {
|
||||
std::vector<T> colorTable = patternToArray<T>(colorTablePattern);
|
||||
auto colorCount = colorTable.size();
|
||||
auto indexCount = indices.size();
|
||||
@@ -94,7 +94,7 @@ namespace hex::plugin::visualizers {
|
||||
return texture;
|
||||
}
|
||||
|
||||
std::vector<u32> getIndices(pl::ptrn::Pattern *pattern, u128 width, u128 height) {
|
||||
std::vector<u32> getIndices(pl::ptrn::Pattern *pattern, u64 width, u64 height) {
|
||||
auto indexCount = 2 * width * height / pattern->getSize();
|
||||
std::vector<u32> indices;
|
||||
auto *iterable = dynamic_cast<pl::ptrn::IIterable *>(pattern);
|
||||
@@ -138,7 +138,7 @@ namespace hex::plugin::visualizers {
|
||||
return indices;
|
||||
}
|
||||
|
||||
ImGuiExt::Texture getTexture(pl::ptrn::Pattern *colorTablePattern, std::vector<u32>& indices, u128 width, u128 height) {
|
||||
ImGuiExt::Texture getTexture(pl::ptrn::Pattern *colorTablePattern, std::vector<u32>& indices, u64 width, u64 height) {
|
||||
ImGuiExt::Texture texture;
|
||||
auto iterable = dynamic_cast<pl::ptrn::IIterable *>(colorTablePattern);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user