Change trim function on Visual Novel.
This commit is contained in:
parent
65a3e23200
commit
9371241af9
@ -38,8 +38,8 @@ All rights reserved.
|
|||||||
#pragma once
|
#pragma once
|
||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 1
|
||||||
#define VERSION_BUILD 8948
|
#define VERSION_BUILD 8950
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -66,12 +66,12 @@ void VisualNovel::Initialize(){
|
|||||||
std::string currentStory;
|
std::string currentStory;
|
||||||
while(file.good()){
|
while(file.good()){
|
||||||
|
|
||||||
auto trim=[](std::string line){
|
auto trim = [](std::string& s)
|
||||||
for(int counter=0;counter<line.length();counter++){
|
{
|
||||||
if(line[counter]!=' '&&line[counter]!='\t')return line.substr(counter);
|
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);
|
||||||
return line;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
auto ReadCSVArgs=[](std::string text){
|
auto ReadCSVArgs=[](std::string text){
|
||||||
std::vector<std::string>args;
|
std::vector<std::string>args;
|
||||||
size_t counter=0;
|
size_t counter=0;
|
||||||
@ -86,7 +86,7 @@ void VisualNovel::Initialize(){
|
|||||||
return args;
|
return args;
|
||||||
};
|
};
|
||||||
std::getline(file,line);
|
std::getline(file,line);
|
||||||
line=trim(line);
|
trim(line);
|
||||||
if(line.length()==0)continue; //It's a blank line, so we skip it.
|
if(line.length()==0)continue; //It's a blank line, so we skip it.
|
||||||
|
|
||||||
switch(line[0]){
|
switch(line[0]){
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user