Sort all layers before splitting them into upper and lower in preparation for sorted rendering.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
5035dd5af9
commit
3e180c26d2
@ -788,6 +788,13 @@ void AiL::PopulateRenderLists(){
|
|||||||
tileForegroundList.clear();
|
tileForegroundList.clear();
|
||||||
|
|
||||||
Player*pl=GetPlayer();
|
Player*pl=GetPlayer();
|
||||||
|
|
||||||
|
std::sort(MONSTER_LIST.begin(),MONSTER_LIST.end(),[](Monster&m1,Monster&m2){return m1->GetPos().y<m2->GetPos().y;});
|
||||||
|
std::sort(ItemDrop::drops.begin(),ItemDrop::drops.end(),[](ItemDrop&id1,ItemDrop&id2){return id1.GetPos().y<id2.GetPos().y;});
|
||||||
|
std::sort(BULLET_LIST.begin(),BULLET_LIST.end(),[](std::unique_ptr<Bullet>&b1,std::unique_ptr<Bullet>&b2){return b1->pos.y<b2->pos.y;});
|
||||||
|
std::sort(foregroundEffects.begin(),foregroundEffects.end(),[](std::unique_ptr<Effect>&e1,std::unique_ptr<Effect>&e2){return e1->pos.y<e2->pos.y;});
|
||||||
|
std::sort(backgroundEffects.begin(),backgroundEffects.end(),[](std::unique_ptr<Effect>&e1,std::unique_ptr<Effect>&e2){return e1->pos.y<e2->pos.y;});
|
||||||
|
|
||||||
for(auto it=MONSTER_LIST.begin();it!=MONSTER_LIST.end();++it){
|
for(auto it=MONSTER_LIST.begin();it!=MONSTER_LIST.end();++it){
|
||||||
Monster&m=*it;
|
Monster&m=*it;
|
||||||
if(m.GetPos().y<pl->GetPos().y){//This monster renders before the player does (behind the player)
|
if(m.GetPos().y<pl->GetPos().y){//This monster renders before the player does (behind the player)
|
||||||
@ -852,11 +859,6 @@ void AiL::PopulateRenderLists(){
|
|||||||
endZones.push_back(zone);
|
endZones.push_back(zone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::sort(monstersBeforeUpper.begin(),monstersBeforeUpper.end(),[](Monster*m1,Monster*m2){return m1->GetPos().y<m2->GetPos().y;});
|
|
||||||
std::sort(monstersBeforeLower.begin(),monstersBeforeLower.end(),[](Monster*m1,Monster*m2){return m1->GetPos().y<m2->GetPos().y;});
|
|
||||||
std::sort(monstersAfterUpper.begin(),monstersAfterUpper.end(),[](Monster*m1,Monster*m2){return m1->GetPos().y<m2->GetPos().y;});
|
|
||||||
std::sort(monstersAfterLower.begin(),monstersAfterLower.end(),[](Monster*m1,Monster*m2){return m1->GetPos().y<m2->GetPos().y;});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AiL::RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d tileSheetPos){
|
void AiL::RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d tileSheetPos){
|
||||||
|
@ -132,6 +132,9 @@ void Audio::PlayBGM(const std::string_view sound,const bool loop){
|
|||||||
void Audio::StopBGM(){
|
void Audio::StopBGM(){
|
||||||
if(Self().BGMIsPlaying()){
|
if(Self().BGMIsPlaying()){
|
||||||
BGM¤tTrack=Self().bgm[Self().currentBGM];
|
BGM¤tTrack=Self().bgm[Self().currentBGM];
|
||||||
|
for(int trackID:currentTrack.GetChannelIDs()){
|
||||||
|
Engine().SetVolume(trackID,0.f);
|
||||||
|
}
|
||||||
for(int trackID:currentTrack.GetChannelIDs()){
|
for(int trackID:currentTrack.GetChannelIDs()){
|
||||||
Engine().Stop(trackID);
|
Engine().Stop(trackID);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,18 @@
|
|||||||
clear
|
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
|
source ./emsdk/emsdk_env.sh
|
||||||
emcmake cmake -DCMAKE_BUILD_TYPE=Release .
|
emcmake cmake -DCMAKE_BUILD_TYPE=Release .
|
||||||
cmake --build . -j 20
|
cmake --build . -j 20
|
Loading…
x
Reference in New Issue
Block a user