diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index f14dadb2..d6ace783 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -788,6 +788,13 @@ void AiL::PopulateRenderLists(){ tileForegroundList.clear(); Player*pl=GetPlayer(); + + std::sort(MONSTER_LIST.begin(),MONSTER_LIST.end(),[](Monster&m1,Monster&m2){return m1->GetPos().yGetPos().y;}); + std::sort(ItemDrop::drops.begin(),ItemDrop::drops.end(),[](ItemDrop&id1,ItemDrop&id2){return id1.GetPos().y&b1,std::unique_ptr&b2){return b1->pos.ypos.y;}); + std::sort(foregroundEffects.begin(),foregroundEffects.end(),[](std::unique_ptr&e1,std::unique_ptr&e2){return e1->pos.ypos.y;}); + std::sort(backgroundEffects.begin(),backgroundEffects.end(),[](std::unique_ptr&e1,std::unique_ptr&e2){return e1->pos.ypos.y;}); + for(auto it=MONSTER_LIST.begin();it!=MONSTER_LIST.end();++it){ Monster&m=*it; if(m.GetPos().yGetPos().y){//This monster renders before the player does (behind the player) @@ -852,11 +859,6 @@ void AiL::PopulateRenderLists(){ endZones.push_back(zone); } } - - std::sort(monstersBeforeUpper.begin(),monstersBeforeUpper.end(),[](Monster*m1,Monster*m2){return m1->GetPos().yGetPos().y;}); - std::sort(monstersBeforeLower.begin(),monstersBeforeLower.end(),[](Monster*m1,Monster*m2){return m1->GetPos().yGetPos().y;}); - std::sort(monstersAfterUpper.begin(),monstersAfterUpper.end(),[](Monster*m1,Monster*m2){return m1->GetPos().yGetPos().y;}); - std::sort(monstersAfterLower.begin(),monstersAfterLower.end(),[](Monster*m1,Monster*m2){return m1->GetPos().yGetPos().y;}); } void AiL::RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d tileSheetPos){ diff --git a/Adventures in Lestoria/Audio.cpp b/Adventures in Lestoria/Audio.cpp index d2031764..f6c18027 100644 --- a/Adventures in Lestoria/Audio.cpp +++ b/Adventures in Lestoria/Audio.cpp @@ -132,6 +132,9 @@ void Audio::PlayBGM(const std::string_view sound,const bool loop){ void Audio::StopBGM(){ if(Self().BGMIsPlaying()){ BGM¤tTrack=Self().bgm[Self().currentBGM]; + for(int trackID:currentTrack.GetChannelIDs()){ + Engine().SetVolume(trackID,0.f); + } for(int trackID:currentTrack.GetChannelIDs()){ Engine().Stop(trackID); } diff --git a/emscripten_build.sh b/emscripten_build.sh index a1634dc0..360bcc56 100755 --- a/emscripten_build.sh +++ b/emscripten_build.sh @@ -1,4 +1,18 @@ clear + +mkdir bin +mkdir bin/assets + +cp -R "Adventures in Lestoria/assets/Campaigns" bin/assets +cp -R "Adventures in Lestoria/assets/config" bin/assets +cp -R "Adventures in Lestoria/assets/maps" bin/assets +rm -R bin/assets/maps/commercial_assets +cp -R "Adventures in Lestoria/assets/monsters" bin/assets +cp -R "Adventures in Lestoria/assets/music" bin/assets +cp -R "Adventures in Lestoria/assets/npcs" bin/assets +cp -R "Adventures in Lestoria/assets/sounds" bin/assets +cp -R "Adventures in Lestoria/assets/gamepack.pak" bin/assets + source ./emsdk/emsdk_env.sh emcmake cmake -DCMAKE_BUILD_TYPE=Release . cmake --build . -j 20 \ No newline at end of file