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:
shweet committed 2026-11-22 17:25:09 -05:00
1 parent 7fb2c607c2
commit 666f65bf3a
174 files changed
+2396 -3154

No files matched your search

+3 -9
View File
@@ -7,14 +7,9 @@
#include "math_util.h"
#include "model/frames.h"
using namespace anm2ed::model;
using namespace anm2ed::util;
namespace anm2ed::edit
{
// A draw as a plain layer frame of one frame: its transform (parents included) taken apart into position, scale and
// rotation. Skew has no place in a plain frame, and is dropped.
Frame draw_frame_bake(const Draw& draw)
static Frame draw_frame_bake(const Draw& draw)
{
auto frame = draw.frame;
auto size = glm::max(frame.size, glm::vec2(1.0f));
@@ -24,7 +19,7 @@ namespace anm2ed::edit
auto scaleX = glm::length(column0);
auto determinant = column0.x * column1.y - column0.y * column1.x;
frame.position = glm::vec2(model * glm::vec4(frame.pivot / size, 0.0f, 1.0f));
frame.scale = math::unit_to_percent(glm::vec2(scaleX, scaleX > 0.0f ? determinant / scaleX : 0.0f));
frame.scale = unit_to_percent(glm::vec2(scaleX, scaleX > 0.0f ? determinant / scaleX : 0.0f));
frame.rotation = glm::degrees(std::atan2(column0.y, column0.x));
frame.skew = {};
frame.depth = 0;
@@ -35,7 +30,7 @@ namespace anm2ed::edit
return frame;
}
bool is_frame_baked_equal(Frame a, const Frame& b)
static bool is_frame_baked_equal(Frame a, const Frame& b)
{
a.uid = b.uid;
a.duration = b.duration;
@@ -163,4 +158,3 @@ namespace anm2ed::edit
std::erase_if(content.layers, is_flattened);
return model;
}
}