Change trim function on Visual Novel.
This commit is contained in:
parent
2f4ec4677a
commit
074a53e34f
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 9020
|
||||
#define VERSION_BUILD 9021
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -66,12 +66,12 @@ void VisualNovel::Initialize(){
|
||||
std::string currentStory;
|
||||
while(file.good()){
|
||||
|
||||
auto trim=[](std::string line){
|
||||
for(int counter=0;counter<line.length();counter++){
|
||||
if(line[counter]!=' '&&line[counter]!='\t')return line.substr(counter);
|
||||
}
|
||||
return line;
|
||||
auto trim = [](std::string& s)
|
||||
{
|
||||
s.erase(0, s.find_first_not_of(" \t\n\r\f\v"));
|
||||
s.erase(s.find_last_not_of(" \t\n\r\f\v") + 1);
|
||||
};
|
||||
|
||||
auto ReadCSVArgs=[](std::string text){
|
||||
std::vector<std::string>args;
|
||||
size_t counter=0;
|
||||
@ -86,7 +86,7 @@ void VisualNovel::Initialize(){
|
||||
return args;
|
||||
};
|
||||
std::getline(file,line);
|
||||
line=trim(line);
|
||||
trim(line);
|
||||
if(line.length()==0)continue; //It's a blank line, so we skip it.
|
||||
|
||||
switch(line[0]){
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user