From 55e98e041c76671a9c514fd47e203271aa2417d9 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 10 Jan 2017 13:25:26 +1100 Subject: [PATCH] Removed unused (or replaceable in case of clamp) functions from helpers. --- src/tracks/track_object.cpp | 5 ++--- src/utils/helpers.cpp | 27 --------------------------- src/utils/helpers.hpp | 6 ------ 3 files changed, 2 insertions(+), 36 deletions(-) diff --git a/src/tracks/track_object.cpp b/src/tracks/track_object.cpp index 2869dedeb..ada404ae6 100644 --- a/src/tracks/track_object.cpp +++ b/src/tracks/track_object.cpp @@ -31,7 +31,7 @@ #include "race/race_manager.hpp" #include "scriptengine/script_engine.hpp" #include "tracks/model_definition_loader.hpp" -#include "utils/helpers.hpp" + #include /** A track object: any additional object on the track. This object implements @@ -332,8 +332,7 @@ void TrackObject::init(const XMLNode &xml_node, scene::ISceneNode* parent, { float power = 1; xml_node.get("bloompower", &power); - power = clampf(power, 0.5f, 10); - + btClamp(power, 0.5f, 10.0f); irr_driver->addForcedBloomNode(glownode, power); } } diff --git a/src/utils/helpers.cpp b/src/utils/helpers.cpp index 5a89b8b43..58a74b712 100644 --- a/src/utils/helpers.cpp +++ b/src/utils/helpers.cpp @@ -22,33 +22,6 @@ #include #include -float clampf(float in, float low, float high) { - return in > high ? high : in < low ? low : in; -} - -unsigned ispow(const unsigned in) { - - if (in < 2) return 0; - - return !(in & (in - 1)); -} - -// Simple 8-bit hash -u8 shash8(const u8 * const data, const u16 size) { - - u32 out = data[0], i; - - for (i = 1; i < size; i++) { - out += data[i] * ((i + 1) ^ data[i - 1]); - } - - out %= 307; // prime - out %= 256; // eight bits - - return out; -} - - /* Copyright (C) 2011 by-2015 Ashima Arts (Simplex noise) diff --git a/src/utils/helpers.hpp b/src/utils/helpers.hpp index 6ee09be4d..5741e7c48 100644 --- a/src/utils/helpers.hpp +++ b/src/utils/helpers.hpp @@ -23,12 +23,6 @@ using irr::video::ITexture; -float clampf(float, float, float); - -unsigned ispow(const unsigned in); - float noise2d(float v1, float v2 = 0); -u8 shash8(const u8 * const data, const u16 size); - #endif