From a1a35fabd0a9acc78bc6dd6d7c97762f307668f6 Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Fri, 8 Sep 2023 17:19:42 +0000 Subject: [PATCH] Emscripten build seems to refuse Co-authored-by: sigonasr2 --- Crawler/C++/scripts/web.sh | 6 ++--- Crawler/Monster.cpp | 8 +++---- Crawler/MonsterAttribute.cpp | 4 ++++ Crawler/MonsterAttribute.h | 29 +++++++++++++------------ Crawler/SlimeKing.cpp | 2 +- Crawler/assets/config/configuration.txt | 2 +- Crawler/sig | 2 +- 7 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 Crawler/MonsterAttribute.cpp diff --git a/Crawler/C++/scripts/web.sh b/Crawler/C++/scripts/web.sh index b575188d..c1d7b984 100755 --- a/Crawler/C++/scripts/web.sh +++ b/Crawler/C++/scripts/web.sh @@ -12,12 +12,12 @@ source ../emsdk/emsdk_env.sh if [ ! -f "pixelGameEngine_wasm.o" ] then printf "Pixel Game Engine compile object missing. Compiling for the first time..." - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 -c pixelGameEngine.cpp -o pixelGameEngine_wasm.o + em++ -std=c++20 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 -c pixelGameEngine.cpp -o pixelGameEngine_wasm.o fi if [ -d "assets" ]; then - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html --preload-file ./assets + em++ -std=c++20 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html --preload-file ./assets else - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html + em++ -std=c++20 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html fi cp buildtemplate.html ${PROJECT_NAME}.html diff --git a/Crawler/Monster.cpp b/Crawler/Monster.cpp index 51ceb16d..2cd29d38 100644 --- a/Crawler/Monster.cpp +++ b/Crawler/Monster.cpp @@ -386,16 +386,16 @@ void Monster::Set(_ATTRIBUTE a,std::variantval){ //Error handling below! //The idea is if we cannot retrieve the value, the program errors out. switch(a.type){ - case Attribute::TYPE::FLOAT:{ + case ATTRIBUTE_TYPE::FLOAT:{ GetFloat(a); }break; - case Attribute::TYPE::INT:{ + case ATTRIBUTE_TYPE::INT:{ GetInt(a); }break; - case Attribute::TYPE::STRING:{ + case ATTRIBUTE_TYPE::STRING:{ GetString(a); }break; - case Attribute::TYPE::BOOL:{ + case ATTRIBUTE_TYPE::BOOL:{ GetBool(a); }break; } diff --git a/Crawler/MonsterAttribute.cpp b/Crawler/MonsterAttribute.cpp new file mode 100644 index 00000000..a54ab993 --- /dev/null +++ b/Crawler/MonsterAttribute.cpp @@ -0,0 +1,4 @@ +#include "MonsterAttribute.h" + +_ATTRIBUTE Attribute::IFRAME_TIME_UPON_HIT{ATTRIBUTE_TYPE::FLOAT}; +_ATTRIBUTE Attribute::SHOOT_RING_TIMER{ATTRIBUTE_TYPE::FLOAT}; \ No newline at end of file diff --git a/Crawler/MonsterAttribute.h b/Crawler/MonsterAttribute.h index e6d62fbb..9f0bfb3a 100644 --- a/Crawler/MonsterAttribute.h +++ b/Crawler/MonsterAttribute.h @@ -1,20 +1,21 @@ +#pragma once #define VARIANTS float,int,std::string,bool -#define CREATE_ATTRIBUTE(variable,type) _ATTRIBUTE variable{Attribute::TYPE::type}; -namespace Attribute{ - enum class TYPE{ - FLOAT, - INT, - STRING, - BOOL, - }; -} +enum class ATTRIBUTE_TYPE{ + FLOAT, + INT, + STRING, + BOOL, +}; struct _ATTRIBUTE{ - Attribute::TYPE type; + ATTRIBUTE_TYPE type; + bool operator<(const _ATTRIBUTE&rhs)const{ + return int(type)