summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-21 17:41:53 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-21 17:41:53 +0200
commiteaf9912741b6b3d35aa5c33170b9f060ded9bc42 (patch)
treefdd656f47ad754d7d51494eab9f3da79fc84af45
parentUpdate glm to 0.9.9.0 (diff)
downloadAltCraft-eaf9912741b6b3d35aa5c33170b9f060ded9bc42.tar
AltCraft-eaf9912741b6b3d35aa5c33170b9f060ded9bc42.tar.gz
AltCraft-eaf9912741b6b3d35aa5c33170b9f060ded9bc42.tar.bz2
AltCraft-eaf9912741b6b3d35aa5c33170b9f060ded9bc42.tar.lz
AltCraft-eaf9912741b6b3d35aa5c33170b9f060ded9bc42.tar.xz
AltCraft-eaf9912741b6b3d35aa5c33170b9f060ded9bc42.tar.zst
AltCraft-eaf9912741b6b3d35aa5c33170b9f060ded9bc42.zip
-rw-r--r--src/AssetManager.cpp9
-rw-r--r--src/AssetManager.hpp1
-rw-r--r--src/TextureAtlas.hpp2
3 files changed, 8 insertions, 4 deletions
diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp
index 6d0f33f..aa796b8 100644
--- a/src/AssetManager.cpp
+++ b/src/AssetManager.cpp
@@ -151,7 +151,8 @@ void ParseAssetTexture(AssetTreeNode &node) {
stbi_image_free(data);
- node.data.swap(std::vector<unsigned char>());
+ node.data.clear();
+ node.data.shrink_to_fit();
}
void ParseAssetBlockModel(AssetTreeNode &node) {
@@ -284,7 +285,8 @@ void ParseAssetBlockModel(AssetTreeNode &node) {
node.asset = std::make_unique<AssetBlockModel>();
dynamic_cast<AssetBlockModel*>(node.asset.get())->blockModel = model;
- node.data.swap(std::vector<unsigned char>());
+ node.data.clear();
+ node.data.shrink_to_fit();
}
void ParseAssetBlockState(AssetTreeNode &node) {
@@ -333,7 +335,8 @@ void ParseAssetBlockState(AssetTreeNode &node) {
AssetBlockState *asset = dynamic_cast<AssetBlockState*>(node.asset.get());
asset->blockState = blockState;
- node.data.swap(std::vector<unsigned char>());
+ node.data.clear();
+ node.data.shrink_to_fit();
}
void ParseBlockModels() {
diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp
index 5d86d9c..3ecff25 100644
--- a/src/AssetManager.hpp
+++ b/src/AssetManager.hpp
@@ -4,6 +4,7 @@
#include <vector>
#include <map>
#include <functional>
+#include <memory>
#include <GL/glew.h>
#include <glm/vec4.hpp>
diff --git a/src/TextureAtlas.hpp b/src/TextureAtlas.hpp
index 76a6c49..1e5c134 100644
--- a/src/TextureAtlas.hpp
+++ b/src/TextureAtlas.hpp
@@ -2,7 +2,7 @@
#include <vector>
-#include <gl/glew.h>
+#include <GL/glew.h>
struct TextureData {
std::vector<unsigned char> data; //expected format RGBA8888