Add in some achievement icons and file hashing saving/loading of save files. Release Build 8515.
This commit is contained in:
@@ -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.;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user