From dad0cb3349cbed376606d21bd38cb9572f5a90f7 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 12 Aug 2023 13:18:23 +0200 Subject: [PATCH] Move transposeTextureData to unnamed namespace --- components/esm3/loadland.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/components/esm3/loadland.cpp b/components/esm3/loadland.cpp index 5cf6c4e94a..be6c4675e2 100644 --- a/components/esm3/loadland.cpp +++ b/components/esm3/loadland.cpp @@ -1,6 +1,7 @@ #include "loadland.hpp" #include +#include #include #include @@ -10,14 +11,17 @@ namespace ESM { - void transposeTextureData(const uint16_t* in, uint16_t* out) + namespace { - int readPos = 0; // bit ugly, but it works - for (int y1 = 0; y1 < 4; y1++) - for (int x1 = 0; x1 < 4; x1++) - for (int y2 = 0; y2 < 4; y2++) - for (int x2 = 0; x2 < 4; x2++) - out[(y1 * 4 + y2) * 16 + (x1 * 4 + x2)] = in[readPos++]; + void transposeTextureData(const std::uint16_t* in, std::uint16_t* out) + { + int readPos = 0; // bit ugly, but it works + for (int y1 = 0; y1 < 4; y1++) + for (int x1 = 0; x1 < 4; x1++) + for (int y2 = 0; y2 < 4; y2++) + for (int x2 = 0; x2 < 4; x2++) + out[(y1 * 4 + y2) * 16 + (x1 * 4 + x2)] = in[readPos++]; + } } Land::~Land()