diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-01-26 10:41:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 10:41:55 +0100 |
commit | 50a94f972d26ee15fc22cce657d13023d1022905 (patch) | |
tree | 24417c741cf85061b73098a32e61ecd3749be05e /src/LinearUpscale.h | |
parent | Redstone: inline -> static (diff) | |
download | cuberite-50a94f972d26ee15fc22cce657d13023d1022905.tar cuberite-50a94f972d26ee15fc22cce657d13023d1022905.tar.gz cuberite-50a94f972d26ee15fc22cce657d13023d1022905.tar.bz2 cuberite-50a94f972d26ee15fc22cce657d13023d1022905.tar.lz cuberite-50a94f972d26ee15fc22cce657d13023d1022905.tar.xz cuberite-50a94f972d26ee15fc22cce657d13023d1022905.tar.zst cuberite-50a94f972d26ee15fc22cce657d13023d1022905.zip |
Diffstat (limited to 'src/LinearUpscale.h')
-rw-r--r-- | src/LinearUpscale.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/LinearUpscale.h b/src/LinearUpscale.h index 349a3a55d..7f3269be5 100644 --- a/src/LinearUpscale.h +++ b/src/LinearUpscale.h @@ -123,11 +123,10 @@ template <typename TYPE> void LinearUpscale2DArray( RatioY[y] = static_cast<TYPE>(y) / a_UpscaleY; } + const int DstSizeX = (a_SrcSizeX - 1) * a_UpscaleX + 1; + [[maybe_unused]] const int DstSizeY = (a_SrcSizeY - 1) * a_UpscaleY + 1; + // Interpolate each XY cell: - int DstSizeX = (a_SrcSizeX - 1) * a_UpscaleX + 1; - #ifdef _DEBUG - int DstSizeY = (a_SrcSizeY - 1) * a_UpscaleY + 1; - #endif for (int y = 0; y < (a_SrcSizeY - 1); y++) { int DstY = y * a_UpscaleY; @@ -204,12 +203,11 @@ template <typename TYPE> void LinearUpscale3DArray( RatioZ[z] = static_cast<TYPE>(z) / a_UpscaleZ; } + const int DstSizeX = (a_SrcSizeX - 1) * a_UpscaleX + 1; + const int DstSizeY = (a_SrcSizeY - 1) * a_UpscaleY + 1; + [[maybe_unused]] const int DstSizeZ = (a_SrcSizeZ - 1) * a_UpscaleZ + 1; + // Interpolate each XYZ cell: - int DstSizeX = (a_SrcSizeX - 1) * a_UpscaleX + 1; - int DstSizeY = (a_SrcSizeY - 1) * a_UpscaleY + 1; - #ifdef _DEBUG - int DstSizeZ = (a_SrcSizeZ - 1) * a_UpscaleZ + 1; - #endif for (int z = 0; z < (a_SrcSizeZ - 1); z++) { int DstZ = z * a_UpscaleZ; |