Add in some achievement icons and file hashing saving/loading of save files. Release Build 8515.

This commit is contained in:
2024-03-29 02:40:06 -05:00
parent d1f95e03c9
commit 3256a686a3
15 changed files with 74 additions and 1 deletions
+25
View File
@@ -148,6 +148,31 @@ std::u32string util::WrapText(PixelGameEngine*pge,std::u32string str,int width,F
return newStr;
}
std::string util::GetHash(std::string fileName){
std::ifstream file(fileName);
std::string hash="";
uint8_t hashIndex=0;
while(file.good()){
uint8_t hashChar=0;
if(hash.size()==std::numeric_limits<uint8_t>::max()){
hashChar=hash[hashIndex];
}
hashChar+=file.get()*21-7;
hashChar^=hashIndex;
if(hashIndex>0)hashChar+=hash[hashIndex-1];
hashChar%=94;
hashChar+=32;
if(hashChar=='"'){hashChar+=60;}
if(hash.size()<std::numeric_limits<uint8_t>::max()){
hash+=hashChar;
}else{
hash[hashIndex]=hashChar;
}
hashIndex++;
}
return hash;
}
long double operator""_Pixels(long double unitDist){
return unitDist/100*24.;
}