Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Jun 20, 2024
1 parent c32e5fe commit 87fb52c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
13 changes: 6 additions & 7 deletions include/threepp/core/BufferAttribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include <memory>
#include <vector>
#include <ranges>

namespace threepp {

Expand Down Expand Up @@ -385,29 +384,29 @@ namespace threepp {
target.set(minX, minY, minZ, maxX, maxY, maxZ);
}

void copy(const TypedBufferAttribute<T>& source) {
void copy(const TypedBufferAttribute& source) {
BufferAttribute::copy(source);

this->count_ = source.count_;
this->array_ = source.array_;
}

[[nodiscard]] std::unique_ptr<TypedBufferAttribute<T>> clone() const {
auto clone = std::unique_ptr<TypedBufferAttribute<T>>(new TypedBufferAttribute<T>());
[[nodiscard]] std::unique_ptr<TypedBufferAttribute> clone() const {
auto clone = std::unique_ptr<TypedBufferAttribute>(new TypedBufferAttribute());
clone->copy(*this);

return clone;
}

static std::unique_ptr<TypedBufferAttribute<T>> create(std::initializer_list<T>&& array, int itemSize, bool normalized = false) {
static std::unique_ptr<TypedBufferAttribute> create(std::initializer_list<T>&& array, int itemSize, bool normalized = false) {

return create(std::vector<T>{array.begin(), array.end()}, itemSize, normalized);
}

template<std::ranges::range Range>
static std::unique_ptr<TypedBufferAttribute<T>> create(const Range& range, int itemSize, bool normalized = false) {
static std::unique_ptr<TypedBufferAttribute> create(const Range& range, int itemSize, bool normalized = false) {

return std::unique_ptr<TypedBufferAttribute<T>>(new TypedBufferAttribute({std::ranges::begin(range), std::ranges::end(range)}, itemSize, normalized));
return std::unique_ptr<TypedBufferAttribute>(new TypedBufferAttribute({std::ranges::begin(range), std::ranges::end(range)}, itemSize, normalized));
}

protected:
Expand Down
1 change: 0 additions & 1 deletion src/threepp/renderers/gl/GLLights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <algorithm>
#include <cmath>
#include <ranges>
#include <unordered_map>

using namespace threepp;
Expand Down

0 comments on commit 87fb52c

Please sign in to comment.