|
|
|
@ -76,6 +76,7 @@ All rights reserved. |
|
|
|
|
|
|
|
|
|
INCLUDE_EMITTER_LIST |
|
|
|
|
INCLUDE_ITEM_CATEGORIES |
|
|
|
|
INCLUDE_BACKDROP_DATA |
|
|
|
|
|
|
|
|
|
bool _DEBUG_MAP_LOAD_INFO = false; |
|
|
|
|
//360x240
|
|
|
|
@ -137,6 +138,9 @@ AiL::AiL() |
|
|
|
|
std::string ITEM_STATS_CONFIG = CONFIG_PATH + "item_stats_config"_S; |
|
|
|
|
utils::datafile::Read(DATA,ITEM_STATS_CONFIG); |
|
|
|
|
|
|
|
|
|
std::string BACKDROP_CONFIG = CONFIG_PATH + "backdrop_config"_S; |
|
|
|
|
utils::datafile::Read(DATA,BACKDROP_CONFIG); |
|
|
|
|
|
|
|
|
|
auto keys=DATA.GetProperty("ItemConfiguration"); |
|
|
|
|
for(auto&[key,value]:keys){ |
|
|
|
|
std::string config=DATA["ItemConfiguration"][key].GetString(); |
|
|
|
@ -835,7 +839,11 @@ void AiL::RenderWorld(float fElapsedTime){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#pragma region Basic Tile Layer Rendering |
|
|
|
|
FillRectDecal({0,0},GetScreenSize(),{100,180,100}); |
|
|
|
|
if(GetCurrentMap().backdrop.length()>0){ |
|
|
|
|
view.DrawPartialDecal({0,0},WINDOW_SIZE,BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition(),WINDOW_SIZE); |
|
|
|
|
}else{ |
|
|
|
|
FillRectDecal({0,0},GetScreenSize(),{100,180,100}); |
|
|
|
|
} |
|
|
|
|
for(RenderMode mode=RenderMode::REFLECTIVE_TILES;mode<=RenderMode::EMPTY_TILES;mode=RenderMode(int(mode)+1)){ |
|
|
|
|
if(mode==RenderMode::NORMAL_TILES){ |
|
|
|
|
SetDecalMode(DecalMode::ADDITIVE); |
|
|
|
@ -929,12 +937,24 @@ void AiL::RenderWorld(float fElapsedTime){ |
|
|
|
|
}break; |
|
|
|
|
case RenderMode::EMPTY_TILES:{ |
|
|
|
|
if(visibleTiles.count({x,y})){ |
|
|
|
|
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); |
|
|
|
|
#pragma region Render Backdrop |
|
|
|
|
if(GetCurrentMap().backdrop.length()>0){ |
|
|
|
|
vf2d tileWorldPos=vi2d{x,y}*GetCurrentMapData().tilewidth; |
|
|
|
|
view.DrawPartialDecal(tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition()+tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)}); |
|
|
|
|
}else{ |
|
|
|
|
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); |
|
|
|
|
} |
|
|
|
|
#pragma endregion |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); |
|
|
|
|
if(GetCurrentMap().backdrop.length()>0){ |
|
|
|
|
vf2d tileWorldPos=vi2d{x,y}*GetCurrentMapData().tilewidth; |
|
|
|
|
view.DrawPartialDecal(tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition()+tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)}); |
|
|
|
|
}else{ |
|
|
|
|
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2171,6 +2191,7 @@ bool AiL::OnUserDestroy(){ |
|
|
|
|
for(auto&[key,value]:MonsterData::imgs){ |
|
|
|
|
delete value; |
|
|
|
|
} |
|
|
|
|
BACKDROP_DATA.clear(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2179,6 +2200,11 @@ void AiL::InitializeLevels(){ |
|
|
|
|
InitializeLevel("map_path"_S+operator""_S(("Levels."+key).c_str(),("Levels."+key).size()),key); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for(auto&[key,size]:DATA["Backdrops"]){ |
|
|
|
|
Renderable&backdrop=BACKDROP_DATA[key]; |
|
|
|
|
backdrop.Load("backdrop_directory"_S+DATA["Backdrops"][key].GetString(),nullptr,false,false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Test::RunMapTests(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|