mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
* A couple of fixes for SDL/Emscripten build.
This commit is contained in:
@@ -20,9 +20,9 @@ Texture AppPlatform_emscripten::loadTexture(const std::string& path, bool b)
|
||||
char *data = emscripten_get_preloaded_image_data(("/" + realPath).c_str(), &out.m_width, &out.m_height);
|
||||
if (data != NULL)
|
||||
{
|
||||
size_t data_size = out.m_width * out.m_height * 4;
|
||||
out.m_pixels = (uint32_t *) new unsigned char[data_size];
|
||||
memcpy(out.m_pixels, data, data_size);
|
||||
size_t data_size = out.m_width * out.m_height;
|
||||
out.m_pixels = new uint32_t[data_size];
|
||||
memcpy(out.m_pixels, data, data_size * sizeof(uint32_t));
|
||||
free(data);
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user