LOWERCASE I AAHHHHHHH

master
sigonasr2 1 year ago
parent ee01343c4e
commit 5f66b590b2
  1. 61
      FiestaCraftingCalculator/FiestaCraftingCalculator.cpp
  2. 14960
      FiestaCraftingCalculator/assets/ItemInfo.txt
  3. 15162
      FiestaCraftingCalculator/assets/ItemViewInfo.csv
  4. 14960
      FiestaCraftingCalculator/assets/ItemViewInfo.txt
  5. 1
      FiestaCraftingCalculator/emscripten_build.ps1
  6. BIN
      FiestaCraftingCalculator/pge.data
  7. 2
      FiestaCraftingCalculator/pge.js
  8. BIN
      FiestaCraftingCalculator/pge.wasm

@ -304,8 +304,6 @@ public:
{ {
// Called once at the start, so create things here // Called once at the start, so create things here
std::ifstream file=std::ifstream("assets/Produce.txt"); std::ifstream file=std::ifstream("assets/Produce.txt");
std::string fileContents=slurp(file);
fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
std::string column=""; std::string column="";
std::vector<std::string>data; std::vector<std::string>data;
//HACK ALERT! If the number of recipes for any of these exceeds 300, a reallocation occurs and all pointers move... //HACK ALERT! If the number of recipes for any of these exceeds 300, a reallocation occurs and all pointers move...
@ -315,12 +313,17 @@ public:
ScrollProdRecipes.reserve(300); ScrollProdRecipes.reserve(300);
CompRecipes.reserve(300); CompRecipes.reserve(300);
DecompRecipes.reserve(300); DecompRecipes.reserve(300);
for(int i=0;i<fileContents.size();i++){ while(file.good()){
if(fileContents[i]=='\t'){ std::string line;
std::getline(file,line);
for(int i=0;i<line.size();i++){
if(line[i]=='\t'){
data.push_back(column); data.push_back(column);
column=""; column="";
} else } else {
if(fileContents[i]=='\n'){ column+=line[i];
}
}
data.push_back(column); data.push_back(column);
column=""; column="";
if(data.size()!=25){ if(data.size()!=25){
@ -357,22 +360,23 @@ public:
} }
data.clear(); data.clear();
} else {
column+=fileContents[i];
}
} }
file=std::ifstream("assets/ItemViewinfo.txt"); file.close();
fileContents=slurp(file); file=std::ifstream("assets/ItemViewInfo.txt");
fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
column=""; column="";
data.clear(); data.clear();
for(int i=0;i<fileContents.size();i++){ while(file.good()){
if(fileContents[i]=='\t'){ std::string line;
std::getline(file,line);
for(int i=0;i<line.size();i++){
if(line[i]=='\t'){
data.push_back(column); data.push_back(column);
column=""; column="";
} else } else {
if(fileContents[i]=='\n'){ column+=line[i];
}
}
data.push_back(column); data.push_back(column);
column=""; column="";
if(data.size()!=27){ if(data.size()!=27){
@ -386,28 +390,26 @@ public:
std::string product=data[1]; std::string product=data[1];
if(IDToName.find(product)!=IDToName.end()){ if(IDToName.find(product)!=IDToName.end()){
IDToName[product]=ItemData{product,{uint8_t(stoi(data[8])),uint8_t(stoi(data[9])),uint8_t(stoi(data[10]))},{data[3],stoi(data[2])},{data[5],stoi(data[4])}}; IDToName[product]=ItemData{product,{uint8_t(stoi(data[8])),uint8_t(stoi(data[9])),uint8_t(stoi(data[10]))},{data[3],stoi(data[2])},{data[5],stoi(data[4])}};
goto quitLoop;
} }
} }
quitLoop:
data.clear(); data.clear();
} else {
column+=fileContents[i];
}
} }
file.close();
file=std::ifstream("assets/ItemInfo.txt"); file=std::ifstream("assets/ItemInfo.txt");
fileContents=slurp(file);
fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
column=""; column="";
data.clear(); data.clear();
for(int i=0;i<fileContents.size();i++){ while(file.good()){
if(fileContents[i]=='\t'){ std::string line;
std::getline(file,line);
for(int i=0;i<line.size();i++){
if(line[i]=='\t'){
data.push_back(column); data.push_back(column);
column=""; column="";
} else } else {
if(fileContents[i]=='\n'){ column+=line[i];
}
}
data.push_back(column); data.push_back(column);
column=""; column="";
if(data.size()!=57){ if(data.size()!=57){
@ -424,9 +426,6 @@ public:
} }
} }
data.clear(); data.clear();
} else {
column+=fileContents[i];
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,2 +1,3 @@
~\Documents\emsdk\emsdk_env.ps1 activate latest ~\Documents\emsdk\emsdk_env.ps1 activate latest
em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 $(Get-ChildItem *.cpp) -o pge.html --preload-file assets em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 $(Get-ChildItem *.cpp) -o pge.html --preload-file assets
emrun pge.html

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 KiB

After

Width:  |  Height:  |  Size: 676 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.
Loading…
Cancel
Save