Skip to content

Commit 60cb32b

Browse files
committed
removed std::function - closes #354
1 parent c4b0e2a commit 60cb32b

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

src/engine/core/MTJD/generic_job.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#pragma once
22

33

4-
#include <functional>
54
#include "job.h"
65
#include "manager.h"
76

@@ -26,7 +25,7 @@ template <class T> class GenericJob : public MTJD::Job
2625
void execute() override { m_function(); }
2726

2827
private:
29-
std::function<void()> m_function;
28+
T m_function;
3029
};
3130

3231

src/renderer/render_scene.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "renderer/texture.h"
3434

3535
#include "universe/universe.h"
36+
#include <cmath>
3637

3738

3839
namespace Lumix

src/renderer/renderer.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ struct BGFXAllocator : public bx::AllocatorI
8484
}
8585

8686

87-
~BGFXAllocator()
88-
{
89-
}
90-
91-
9287
static const size_t NATURAL_ALIGNEMENT = 8;
9388

9489

@@ -111,25 +106,18 @@ struct BGFXAllocator : public bx::AllocatorI
111106
}
112107
else if (!_ptr)
113108
{
114-
if (NATURAL_ALIGNEMENT >= _alignment)
115-
{
116-
return m_source.allocate(_size);
117-
}
109+
if (NATURAL_ALIGNEMENT >= _alignment) return m_source.allocate(_size);
118110

119111
return m_source.allocate_aligned(_size, _alignment);
120112
}
121113

122-
if (NATURAL_ALIGNEMENT >= _alignment)
123-
{
124-
return m_source.reallocate(_ptr, _size);
125-
}
114+
if (NATURAL_ALIGNEMENT >= _alignment) return m_source.reallocate(_ptr, _size);
126115

127116
return m_source.reallocate_aligned(_ptr, _size, _alignment);
128117
}
129118

130119

131120
Lumix::IAllocator& m_source;
132-
133121
};
134122

135123

0 commit comments

Comments
 (0)