Update ARM GNU toolchain to version 12.3-rel1 #64

Merged
TheBrokenRail merged 4 commits from taylorthemushroom/minecraft-pi-reborn:master into master 2023-10-20 01:13:06 +00:00
1 changed files with 5 additions and 4 deletions
Showing only changes of commit 5432664f77 - Show all commits

View File

@ -14,10 +14,11 @@
// Read Asset File
static AppPlatform_readAssetFile_return_value AppPlatform_readAssetFile_injection(__attribute__((unused)) unsigned char *app_platform, std::string const& path) {
// Read File
std::string full_path("data/");
full_path.append(path);
std::ifstream stream(full_path);
std::string str((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
std::ifstream stream("data/" + path, std::ios_base::binary | std::ios_base::ate);
long len = stream.tellg();
char *buf = new char[len];
stream.seekg(0, stream.beg);
stream.read(buf, len);
// Return String
AppPlatform_readAssetFile_return_value ret;
ret.length = str.length();