diff options
author | chai <chaifix@163.com> | 2018-10-21 13:37:27 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-21 13:37:27 +0800 |
commit | 066e5987c515dfc34537d73ca9d2a81ddd1f9e1b (patch) | |
tree | ec45fe523daa4f9e8a30db0a045a0eb9cee84822 /src/lua/modules/graphics/graphics.cpp | |
parent | 3292019e55dd02a96420e72bad88711fd36ef249 (diff) |
*注释
Diffstat (limited to 'src/lua/modules/graphics/graphics.cpp')
-rw-r--r-- | src/lua/modules/graphics/graphics.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lua/modules/graphics/graphics.cpp b/src/lua/modules/graphics/graphics.cpp index 573f319..4ff0dfc 100644 --- a/src/lua/modules/graphics/graphics.cpp +++ b/src/lua/modules/graphics/graphics.cpp @@ -10,6 +10,7 @@ namespace JinEngine { namespace Lua { + using namespace std; using namespace JinEngine; using namespace JinEngine::Graphics; @@ -125,12 +126,12 @@ namespace JinEngine goto fail; } Buffer b = {}; - if (!fs->read(f, &b)) + if (!fs->read(f, b)) { error(L, "Failed to read image %s", f); goto fail; } - bitmap = Bitmap::createBitmap(b.data, b.size); + bitmap = Bitmap::createBitmap(&b, b.size()); //const Color* col = bitmap->getPixels(); //ofstream o = ofstream("img.txt", ios_base::app); //for (int i = 0; i < bitmap->getWidth() * bitmap->getHeight(); ++i) @@ -195,8 +196,8 @@ namespace JinEngine return 1; } Buffer b; - fs->read(path, &b); - Shader* jsl = Shader::createShader((char*)b.data); + fs->read(path, b); + Shader* jsl = Shader::createShader((char*)&b); if (jsl == nullptr) { error(L, "Failed to compile shader"); @@ -618,8 +619,8 @@ namespace JinEngine return 1; } Buffer b; - fs->read(path, &b); - fd = TTFData::createTTFData((unsigned char*)b.data, b.size); + fs->read(path, b); + fd = TTFData::createTTFData(&b, b.size()); } proxy->bind(new Ref<TTFData>(fd, JIN_GRAPHICS_TTFDATA)); return 1; |