Emscripten build seems to refuse

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/28/head
Nic0Nic0Nii 2 years ago
parent 39c4db9c6f
commit a1a35fabd0
  1. 6
      Crawler/C++/scripts/web.sh
  2. 8
      Crawler/Monster.cpp
  3. 4
      Crawler/MonsterAttribute.cpp
  4. 21
      Crawler/MonsterAttribute.h
  5. 2
      Crawler/SlimeKing.cpp
  6. 2
      Crawler/assets/config/configuration.txt
  7. 2
      Crawler/sig

@ -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

@ -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;
} }

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

@ -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{ struct _ATTRIBUTE{
Attribute::TYPE type; ATTRIBUTE_TYPE type;
bool operator<(const _ATTRIBUTE&rhs)const{
return int(type)<int(rhs.type);
}
}; };
namespace Attribute{ struct Attribute{
CREATE_ATTRIBUTE(IFRAME_TIME_UPON_HIT,FLOAT); static _ATTRIBUTE IFRAME_TIME_UPON_HIT;
CREATE_ATTRIBUTE(SHOOT_RING_TIMER,FLOAT); static _ATTRIBUTE SHOOT_RING_TIMER;
} };

@ -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;

@ -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

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

Loading…
Cancel
Save