From c3c3137ab3a3d09c12eaa7140cb7ec760bdfe924 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sat, 14 Dec 2019 12:13:09 +0000 Subject: BACKENDS: Move nextHigher2() into common/algorithm.h --- backends/platform/3ds/sprite.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/3ds/sprite.cpp b/backends/platform/3ds/sprite.cpp index bbccf94fe6..74805b40cb 100644 --- a/backends/platform/3ds/sprite.cpp +++ b/backends/platform/3ds/sprite.cpp @@ -21,20 +21,9 @@ */ #include "backends/platform/3ds/sprite.h" +#include "common/algorithm.h" #include "common/util.h" -static uint nextHigher2(uint v) { - if (v == 0) - return 1; - v--; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - return ++v; -} - Sprite::Sprite() : dirtyPixels(true) , dirtyMatrix(true) @@ -62,8 +51,8 @@ void Sprite::create(uint16 width, uint16 height, const Graphics::PixelFormat &f) actualWidth = width; actualHeight = height; format = f; - w = MAX(nextHigher2(width), 64u); - h = MAX(nextHigher2(height), 64u); + w = MAX(Common::nextHigher2(width), 64u); + h = MAX(Common::nextHigher2(height), 64u); pitch = w * format.bytesPerPixel; dirtyPixels = true; -- cgit v1.2.3