Added backdrop property and backdrop loading to maps. Release build 5549.
This commit is contained in:
@@ -33,6 +33,17 @@
|
||||
"wangset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
"name": "Backdrop",
|
||||
"storageType": "string",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
"None",
|
||||
"forest"
|
||||
],
|
||||
"valuesAsFlags": false
|
||||
},
|
||||
{
|
||||
"id": 27,
|
||||
"name": "BGM",
|
||||
@@ -213,6 +224,12 @@
|
||||
"drawFill": true,
|
||||
"id": 19,
|
||||
"members": [
|
||||
{
|
||||
"name": "Backdrop",
|
||||
"propertyType": "Backdrop",
|
||||
"type": "string",
|
||||
"value": "None"
|
||||
},
|
||||
{
|
||||
"name": "Background Music",
|
||||
"propertyType": "BGM",
|
||||
|
||||
@@ -679,6 +679,7 @@
|
||||
<Text Include="assets\config\classes\Witch.txt" />
|
||||
<Text Include="assets\config\classes\Wizard.txt" />
|
||||
<Text Include="assets\config\configuration.txt" />
|
||||
<Text Include="assets\config\gfx\backdrops.txt" />
|
||||
<Text Include="assets\config\gfx\gfx.txt" />
|
||||
<Text Include="assets\config\gfx\themes.txt" />
|
||||
<Text Include="assets\config\items\Accessories.txt" />
|
||||
|
||||
@@ -843,6 +843,9 @@
|
||||
<Text Include="assets\config\audio\events.txt">
|
||||
<Filter>Configurations\Audio</Filter>
|
||||
</Text>
|
||||
<Text Include="assets\config\gfx\backdrops.txt">
|
||||
<Filter>Configurations\GFX</Filter>
|
||||
</Text>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="assets\heart.ico">
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ All rights reserved.
|
||||
#include "discord.h"
|
||||
#endif
|
||||
#include "Audio.h"
|
||||
#include "olcPGEX_SplashScreen.h"
|
||||
|
||||
class AiL : public olc::PixelGameEngine
|
||||
{
|
||||
@@ -63,6 +64,7 @@ class AiL : public olc::PixelGameEngine
|
||||
friend class sig::Animation;
|
||||
friend class Audio;
|
||||
std::unique_ptr<Player>player;
|
||||
SplashScreen splash;
|
||||
public:
|
||||
Pathfinding pathfinder;
|
||||
static InputGroup KEY_CONFIRM;
|
||||
|
||||
@@ -36,6 +36,11 @@ All rights reserved.
|
||||
*/
|
||||
#pragma endregion
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
using BackdropName=std::string;
|
||||
|
||||
#define INCLUDE_ANIMATION_DATA extern safemap<std::string,Animate2D::FrameSequence>ANIMATION_DATA;
|
||||
#define INCLUDE_MONSTER_LIST extern std::vector<Monster>MONSTER_LIST;
|
||||
#define INCLUDE_SPAWNER_LIST extern std::vector<MonsterSpawner>SPAWNER_LIST;
|
||||
@@ -53,6 +58,9 @@ All rights reserved.
|
||||
#define DO_NOTHING [](MenuFuncData data){return true;}
|
||||
#define INCLUDE_WINDOW_SIZE extern vi2d WINDOW_SIZE;
|
||||
|
||||
#define INCLUDE_BACKDROP_DATA extern std::map<BackdropName,Renderable>BACKDROP_DATA;
|
||||
|
||||
|
||||
#define INCLUDE_CENTERED extern const vf2d Menu::CENTERED;
|
||||
|
||||
#define ACCESS_PLAYER Player*p=game->GetPlayer();
|
||||
|
||||
@@ -41,8 +41,11 @@ All rights reserved.
|
||||
|
||||
INCLUDE_game
|
||||
|
||||
using BackdropName=std::string;
|
||||
|
||||
float TileGroup::FADE_TIME=0.3f;
|
||||
uint8_t TileGroup::FADE_AMT=160;
|
||||
std::map<BackdropName,Renderable>BACKDROP_DATA;
|
||||
|
||||
Map&MapHelper::MapFromString(std::string mapName){
|
||||
return game->MAP_DATA.at(mapName);
|
||||
|
||||
@@ -101,6 +101,7 @@ struct Map{
|
||||
std::vector<EnvironmentalAudio>environmentalAudioData;
|
||||
std::string mapType="";
|
||||
std::string bgmSongName="";
|
||||
BackdropName backdrop="";
|
||||
std::set<std::string>spawns;
|
||||
std::map<int,SpawnerTag> SpawnerData; //Spawn groups have IDs, mobs associate which spawner they are tied to via this ID.
|
||||
std::map<std::string,std::vector<::ZoneData>> ZoneData;
|
||||
@@ -365,6 +366,11 @@ class TMXParser{
|
||||
parsedMapInfo.bgmSongName=newTag.data["value"];
|
||||
}
|
||||
} else
|
||||
if (newTag.tag=="property"&&newTag.data["name"]=="Backdrop") {
|
||||
if(newTag.data["value"]!="None"){ //None is a default value that we ignore.
|
||||
parsedMapInfo.backdrop=newTag.data["value"];
|
||||
}
|
||||
} else
|
||||
if (newTag.tag=="object"&&newTag.data["type"]=="AudioEnvironmentalSound") {
|
||||
parsedMapInfo.environmentalAudioData.emplace_back();
|
||||
prevAudioData=&parsedMapInfo.environmentalAudioData.back();
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
January 1st
|
||||
===========
|
||||
The Hub / NPC Interactions
|
||||
Audio Engine
|
||||
- Audio Ambience Zones
|
||||
- Menu Sound Effects
|
||||
- Attack / Enemy Sound Effects
|
||||
- Music Loading/Looping
|
||||
Settings Menu
|
||||
- Any settings should be saved to the save file!
|
||||
- Volume Controls
|
||||
@@ -18,8 +13,6 @@ Settings Menu
|
||||
-Click on title screen should not process as input immediately.
|
||||
|
||||
-Investigate why frame rate matters for intro screen.
|
||||
-Warrior slash should occur even with no target
|
||||
-Add in other story plates
|
||||
-Faster main menu screen transition
|
||||
-Simplify map collision tiles by removing the requirement for hidden boundaries.
|
||||
-Loading should happen on fadeout.
|
||||
|
||||
@@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 1
|
||||
#define VERSION_BUILD 5533
|
||||
#define VERSION_BUILD 5549
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 MiB |
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="10" nextobjectid="177">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="174" height="144" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="108">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="240" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="7" nextobjectid="18">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="200" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="9" nextobjectid="23">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="200" height="250" tilewidth="24" tileheight="24" infinite="0" nextlayerid="7" nextobjectid="30">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="250" height="175" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="31">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="225" height="150" tilewidth="24" tileheight="24" infinite="0" nextlayerid="7" nextobjectid="24">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="250" height="125" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="26">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||
</properties>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="64" height="80" tilewidth="24" tileheight="24" infinite="0" nextlayerid="5" nextobjectid="6">
|
||||
<properties>
|
||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||
<property name="Background Music" propertytype="BGM" value="foresty_boss"/>
|
||||
<property name="Level Type" propertytype="LevelType" value="Boss"/>
|
||||
</properties>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
@@ -59,6 +59,12 @@ item_img_directory = items/
|
||||
# Path to story files
|
||||
story_directory = config/story/
|
||||
|
||||
# Path to backdrop config file
|
||||
backdrop_config = gfx/backdrops.txt
|
||||
|
||||
# Path to backdrop background files
|
||||
backdrop_directory = assets/backgrounds/
|
||||
|
||||
# Path to sound effect files
|
||||
sfx_directory = assets/sounds/
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
Backdrops
|
||||
{
|
||||
forest = forest_backdrop.png
|
||||
}
|
||||
|
||||
Backdrop Config
|
||||
{
|
||||
# Amount to move per pixel of actual world space.
|
||||
Speed Ratio = 0.125
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 211 B |
@@ -50,4 +50,6 @@ All rights reserved.
|
||||
#define TSX_PARSER_SETUP
|
||||
#include "TSXParser.h"
|
||||
#define OLC_PGEX_MINIAUDIO
|
||||
#include "olcPGEX_MiniAudio.h"
|
||||
#include "olcPGEX_MiniAudio.h"
|
||||
#define OLC_PGEX_SPLASHSCREEN
|
||||
#include "olcPGEX_SplashScreen.h"
|
||||
Binary file not shown.
Reference in New Issue
Block a user