Added quotes for linux build script. Automatically create metadata file if missing when hitting Load Game

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2 2024-01-12 13:22:24 -06:00
parent b97afb24bd
commit 705bb9b9fb
9 changed files with 13 additions and 9 deletions

12
Adventures in Lestoria/C++/scripts/build.sh Normal file → Executable file
View File

@ -15,20 +15,20 @@ if [ "$1" = "test" ]
then then
printf "Running tests...\n" printf "Running tests...\n"
echo "#define TEST_SUITE" > ./test/test.h echo "#define TEST_SUITE" > ./test/test.h
if g++ $(find . -type f -name "*.cpp" -not -name "pixelGameEngine.cpp") pixelGameEngine.o ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then if g++ $(find . -type f -name "*.cpp" -not -name "pixelGameEngine.cpp") pixelGameEngine.o ${CUSTOM_PARAMS} -o "${PROJECT_NAME}"; then
./${PROJECT_NAME} "$@" "./${PROJECT_NAME}" "$@"
fi fi
elif [ "$1" = "full" ] elif [ "$1" = "full" ]
then then
echo "" > ./test/test.h echo "" > ./test/test.h
g++ ${CUSTOM_PARAMS} -c pixelGameEngine.cpp g++ ${CUSTOM_PARAMS} -c pixelGameEngine.cpp
if g++ $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine.o ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then if g++ $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine.o ${CUSTOM_PARAMS} -o "${PROJECT_NAME}"; then
./${PROJECT_NAME} "$@" "./${PROJECT_NAME}" "$@"
fi fi
else else
echo "" > ./test/test.h echo "" > ./test/test.h
if g++ $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine.o ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then if g++ $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine.o ${CUSTOM_PARAMS} -o "${PROJECT_NAME}"; then
./${PROJECT_NAME} "$@" "./${PROJECT_NAME}" "$@"
fi fi
fi fi
printf "\n\n" printf "\n\n"

0
Adventures in Lestoria/C++/scripts/commit.sh Normal file → Executable file
View File

0
Adventures in Lestoria/C++/scripts/debug.sh Normal file → Executable file
View File

0
Adventures in Lestoria/C++/scripts/lines.sh Normal file → Executable file
View File

0
Adventures in Lestoria/C++/scripts/release.sh Normal file → Executable file
View File

0
Adventures in Lestoria/C++/scripts/temp Normal file → Executable file
View File

0
Adventures in Lestoria/C++/scripts/web.sh Normal file → Executable file
View File

View File

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType Portions of this software are copyright <EFBFBD> 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information. Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved. All rights reserved.
*/ */
@ -210,11 +210,15 @@ const void SaveFile::SetSaveFileID(size_t saveFileID){
} }
const void SaveFile::UpdateSaveGameData(){ const void SaveFile::UpdateSaveGameData(){
std::filesystem::create_directories("save_file_path"_S);
auto LoadMetadataFile=[](){ auto LoadMetadataFile=[](){
auto gameFilesList=Component<ScrollableWindowComponent>(LOAD_GAME,"Game Files List"); auto gameFilesList=Component<ScrollableWindowComponent>(LOAD_GAME,"Game Files List");
gameFilesList->RemoveAllComponents(); gameFilesList->RemoveAllComponents();
const size_t saveFileCount=GetSaveFileCount(); const size_t saveFileCount=GetSaveFileCount();
utils::datafile metadata; utils::datafile metadata;
if(!std::filesystem::exists("save_file_path"_S+"metadata.dat")){
utils::datafile::Write(metadata,"save_file_path"_S+"metadata.dat");
}
utils::datafile::Read(metadata,"save_file_path"_S+"metadata.dat"); utils::datafile::Read(metadata,"save_file_path"_S+"metadata.dat");
float offsetY=0; float offsetY=0;
for(size_t i=0;i<saveFileCount;i++){ for(size_t i=0;i<saveFileCount;i++){
@ -257,7 +261,7 @@ const std::string SaveFile::CreateServerRequest(const SaveFileOperation::Operati
; / ? : @ & = + $ , ; / ? : @ & = + $ ,
uriMark ::: one of uriMark ::: one of
- _ . ! ~ * ' ( ) - _ . ! ~ * ' ( )
Let unescapedURISet be a String containing one instance of each character valid in uriReserved and uriUnescaped plus #. Let unescapedURISet be a String containing one instance of each character valid in uriReserved and uriUnescaped plus <EFBFBD>#<EFBFBD>.
*/ */
const std::array uriReserved={';','/','?',':','@','&','=','+','$',',','-','_','.','!','~','*','\'','(',')','#'}; const std::array uriReserved={';','/','?',':','@','&','=','+','$',',','-','_','.','!','~','*','\'','(',')','#'};
if(c>='A'&&c<='Z'||c>='a'&&c<='z'||c>='0'&&c<='9'||std::find(uriReserved.begin(),uriReserved.end(),c)!=uriReserved.end())return std::move(str)+c; if(c>='A'&&c<='Z'||c>='a'&&c<='z'||c>='0'&&c<='9'||std::find(uriReserved.begin(),uriReserved.end(),c)!=uriReserved.end())return std::move(str)+c;

2
Adventures in Lestoria/sig Normal file → Executable file
View File

@ -1,4 +1,4 @@
export AUTO_UPDATE=true export AUTO_UPDATE=false
source utils/define.sh source utils/define.sh