App::I static singleton to pointer

This commit is contained in:
2019-07-11 18:08:17 +02:00
parent 92dd00d910
commit b89274e7a6
33 changed files with 417 additions and 412 deletions

View File

@@ -231,11 +231,11 @@ std::vector<NodeStrokePreview::StrokeFrame> NodeStrokePreview::stroke_draw_compu
glm::vec2 mixer_bb_max(0, 0);
for (int j = 0; j < 4; j++)
{
auto p = (xy(prev.pos) + App::I.zoom * s.scale * off_mix[j] * glm::orientate2(-s.angle));
auto p = (xy(prev.pos) + App::I->zoom * s.scale * off_mix[j] * glm::orientate2(-s.angle));
mixer_bb_min = glm::max({ 0, 0 }, glm::min(mixer_bb_min, p));
mixer_bb_max = glm::min(mixer_sz, glm::max(mixer_bb_max, p));
B[j].pos = glm::vec4(xy(s.pos) + App::I.zoom * s.scale * off[j] * glm::orientate2(-s.angle) - glm::vec2(0, 1), 1, 1);
B[j].pos = glm::vec4(xy(s.pos) + App::I->zoom * s.scale * off[j] * glm::orientate2(-s.angle) - glm::vec2(0, 1), 1, 1);
B[j].uvs2 = p / mixer_sz;
}
@@ -314,13 +314,13 @@ void NodeStrokePreview::draw_stroke_immediate()
{
float min_pad = size.x * 0.05f;
float pad = (5.f + glm::max(glm::min(m_stroke.m_max_size, m_brush->m_tip_size) / 2.f, min_pad)) * App::I.zoom;
float pad = (5.f + glm::max(glm::min(m_stroke.m_max_size, m_brush->m_tip_size) / 2.f, min_pad)) * App::I->zoom;
if (b->m_tip_size_pressure)
pad = min_pad * App::I.zoom;
pad = min_pad * App::I->zoom;
if (!glm::isnan(m_pad_override))
pad = m_pad_override;
float w = m_size.x * App::I.zoom;
float h = m_size.y * App::I.zoom;
float w = m_size.x * App::I->zoom;
float h = m_size.y * App::I->zoom;
std::vector<glm::vec2> kp = {
{ pad, h / 2.f },
{ w / 2.f, 0 },
@@ -529,7 +529,7 @@ void NodeStrokePreview::draw_stroke()
bool to_unload = (node->m_brush->m_tip_texture == nullptr);
node->m_brush->preload();
App::I.render_task([node, to_unload]
App::I->render_task([node, to_unload]
{
gl_state gl;
gl.save();