Remove namespaces, and make file-local helpers static
Names that only a namespace told apart get prefixes: TOOL_PAN, FONT_BOLD, ICON_FOLDER, COLOR_WHITE, path_to_utf8 and so on. The OpenGL shader class is ShaderProgram, and its uniform ShaderUniform, beside the document's Shader and Uniform. Free functions a member of the same name would hide are called through :: for now. Two unused shader window helpers are gone.
This commit is contained in:
1 parent
7fb2c607c2
commit
666f65bf3a
174 files changed
+2396
-3154
No files matched your search
+4
-7
@@ -5,24 +5,22 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace anm2ed::util::vector
|
||||
{
|
||||
template <typename T> T* find(std::vector<T>& v, int index)
|
||||
template <typename T> T* vector_find(std::vector<T>& v, int index)
|
||||
{
|
||||
return index >= 0 && index < (int)v.size() ? &v[index] : nullptr;
|
||||
}
|
||||
|
||||
template <typename T> int find_index(const std::vector<T>& v, const T& value)
|
||||
template <typename T> int vector_index_find(const std::vector<T>& v, const T& value)
|
||||
{
|
||||
auto it = std::find(v.begin(), v.end(), value);
|
||||
if (it == v.end()) return -1;
|
||||
return (int)(std::distance(v.begin(), it));
|
||||
}
|
||||
|
||||
template <typename T> bool in_bounds(std::vector<T>& v, int index) { return index >= 0 && index < (int)v.size(); }
|
||||
template <typename T> bool is_vector_in_bounds(std::vector<T>& v, int index) { return index >= 0 && index < (int)v.size(); }
|
||||
|
||||
template <typename T>
|
||||
std::set<int> move_indices_to_position(std::vector<T>& v, const std::vector<int>& indices, int insertPos)
|
||||
std::set<int> vector_indices_move(std::vector<T>& v, const std::vector<int>& indices, int insertPos)
|
||||
{
|
||||
if (indices.empty()) return {};
|
||||
|
||||
@@ -54,4 +52,3 @@ namespace anm2ed::util::vector
|
||||
|
||||
return moveIndices;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user