Emscripten build seems to refuse

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
Nic0Nic0Nii 2023-09-08 17:19:42 +00:00
parent 48bdcfe36f
commit 4c8e43e093
7 changed files with 31 additions and 26 deletions

View File

@ -12,12 +12,12 @@ source ../emsdk/emsdk_env.sh
if [ ! -f "pixelGameEngine_wasm.o" ] if [ ! -f "pixelGameEngine_wasm.o" ]
then then
printf "Pixel Game Engine compile object missing. Compiling for the first time..." 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 fi
if [ -d "assets" ]; then 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 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 fi
cp buildtemplate.html ${PROJECT_NAME}.html cp buildtemplate.html ${PROJECT_NAME}.html

View File

@ -386,16 +386,16 @@ void Monster::Set(_ATTRIBUTE a,std::variant<VARIANTS>val){
//Error handling below! //Error handling below!
//The idea is if we cannot retrieve the value, the program errors out. //The idea is if we cannot retrieve the value, the program errors out.
switch(a.type){ switch(a.type){
case Attribute::TYPE::FLOAT:{ case ATTRIBUTE_TYPE::FLOAT:{
GetFloat(a); GetFloat(a);
}break; }break;
case Attribute::TYPE::INT:{ case ATTRIBUTE_TYPE::INT:{
GetInt(a); GetInt(a);
}break; }break;
case Attribute::TYPE::STRING:{ case ATTRIBUTE_TYPE::STRING:{
GetString(a); GetString(a);
}break; }break;
case Attribute::TYPE::BOOL:{ case ATTRIBUTE_TYPE::BOOL:{
GetBool(a); GetBool(a);
}break; }break;
} }

View File

@ -0,0 +1,4 @@
#include "MonsterAttribute.h"
_ATTRIBUTE Attribute::IFRAME_TIME_UPON_HIT{ATTRIBUTE_TYPE::FLOAT};
_ATTRIBUTE Attribute::SHOOT_RING_TIMER{ATTRIBUTE_TYPE::FLOAT};

View File

@ -1,20 +1,21 @@
#pragma once
#define VARIANTS float,int,std::string,bool #define VARIANTS float,int,std::string,bool
#define CREATE_ATTRIBUTE(variable,type) _ATTRIBUTE variable{Attribute::TYPE::type};
namespace Attribute{ enum class ATTRIBUTE_TYPE{
enum class TYPE{
FLOAT, FLOAT,
INT, INT,
STRING, STRING,
BOOL, BOOL,
};
}
struct _ATTRIBUTE{
Attribute::TYPE type;
}; };
namespace Attribute{ struct _ATTRIBUTE{
CREATE_ATTRIBUTE(IFRAME_TIME_UPON_HIT,FLOAT); ATTRIBUTE_TYPE type;
CREATE_ATTRIBUTE(SHOOT_RING_TIMER,FLOAT); bool operator<(const _ATTRIBUTE&rhs)const{
} return int(type)<int(rhs.type);
}
};
struct Attribute{
static _ATTRIBUTE IFRAME_TIME_UPON_HIT;
static _ATTRIBUTE SHOOT_RING_TIMER;
};

View File

@ -12,7 +12,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe
case 0:{ case 0:{
m.size=ConfigInt("Phase1.Size")/100; m.size=ConfigInt("Phase1.Size")/100;
m.diesNormally=false; m.diesNormally=false;
m.Set(Attribute::IFRAME_TIME_UPON_HIT,0.f); m.Set(Attribute::IFRAME_TIME_UPON_HIT,0);
m.iframe_timer=ConfigFloat("Phase5.IframeTimePerHit"); m.iframe_timer=ConfigFloat("Phase5.IframeTimePerHit");
m.phase=1; m.phase=1;
}break; }break;

View File

@ -10,7 +10,7 @@ gfx_config = gfx/gfx.txt
map_config = levels.txt map_config = levels.txt
# Starting map when loading the game. # Starting map when loading the game.
starting_map = CAMPAIGN_1_1 starting_map = BOSS_1
# Player Properties Loading Config # Player Properties Loading Config
player_config = Player.txt player_config = Player.txt

View File

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