diff options
author | chai <chaifix@163.com> | 2018-10-21 16:21:16 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-21 16:21:16 +0800 |
commit | 07770f3ad369ff47386310b731d349f7af1fe0d9 (patch) | |
tree | 7547b1a8b2beaceb31ea1b62edbdaa5cd6a1b247 /src/libjin/Graphics/je_bitmap.cpp | |
parent | 066e5987c515dfc34537d73ca9d2a81ddd1f9e1b (diff) |
*修改编译控制
Diffstat (limited to 'src/libjin/Graphics/je_bitmap.cpp')
-rw-r--r-- | src/libjin/Graphics/je_bitmap.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libjin/Graphics/je_bitmap.cpp b/src/libjin/Graphics/je_bitmap.cpp index 5269606..0747f0b 100644 --- a/src/libjin/Graphics/je_bitmap.cpp +++ b/src/libjin/Graphics/je_bitmap.cpp @@ -1,9 +1,12 @@ #define STB_IMAGE_IMPLEMENTATION #include "../3rdparty/stb/stb_image.h" + +#include "../filesystem/je_asset_database.h" #include "../math/je_math.h" #include "je_bitmap.h" +using namespace JinEngine::Filesystem; using namespace JinEngine::Math; namespace JinEngine @@ -11,6 +14,14 @@ namespace JinEngine namespace Graphics { + Bitmap* Bitmap::createBitmap(const char* path) + { + AssetDatabase* ad = AssetDatabase::get(); + Buffer buffer; + ad->read(path, buffer); + return createBitmap(&buffer, buffer.size()); + } + /* pixelbitmap */ Bitmap* Bitmap::createBitmap(const void* pixel, unsigned width, unsigned height) { |