Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Olympe::Tiled Namespace Reference

Namespaces

namespace  anonymous_namespace{TiledToOlympe.cpp}
 

Classes

struct  ConversionConfig
 
class  IsometricProjection
 
struct  LayerProperties
 
class  LevelParser
 
struct  LevelParseResult
 
struct  ObjectReference
 
struct  ObjectTypeCensus
 
struct  ParallaxLayer
 
class  ParallaxLayerManager
 
struct  Point
 
struct  ResolvedGid
 
struct  TiledChunk
 
class  TiledDecoder
 
struct  TiledLayer
 
class  TiledLevelLoader
 
struct  TiledMap
 
struct  TiledObject
 
struct  TiledProperty
 
struct  TiledTile
 
struct  TiledTileset
 
class  TiledToOlympe
 
class  TilesetCache
 
class  TilesetParser
 
struct  VisualResourceManifest
 

Typedefs

using json = nlohmann::json
 

Enumerations

enum class  PropertyType {
  String , Int , Float , Bool ,
  Color , File , Object
}
 
enum class  LayerType { TileLayer , ObjectGroup , ImageLayer , Group }
 
enum class  ObjectType {
  Rectangle , Ellipse , Point , Polygon ,
  Polyline , Text
}
 
enum class  MapOrientation { Orthogonal , Isometric , Staggered , Hexagonal }
 
enum class  RenderOrder { RightDown , RightUp , LeftDown , LeftUp }
 

Functions

std::string GetString (const json &j, const std::string &key, const std::string &defaultValue="")
 
int GetInt (const json &j, const std::string &key, int defaultValue=0)
 
float GetFloat (const json &j, const std::string &key, float defaultValue=0.0f)
 
double GetDouble (const json &j, const std::string &key, double defaultValue=0.0)
 
bool GetBool (const json &j, const std::string &key, bool defaultValue=false)
 
json GetArray (const json &j, const std::string &key)
 
json GetObject (const json &j, const std::string &key)
 
bool HasKey (const json &j, const std::string &key)
 
size_t GetArraySize (const json &j)
 
int ParseColor (const std::string &colorStr)
 
std::string ColorToString (int color)
 
LayerProperties ParseLayerProperties (const std::map< std::string, TiledProperty > &properties)
 
std::ostream & operator<< (std::ostream &os, MapOrientation orientation)
 
uint32_t GetTileId (uint32_t gid)
 
bool IsFlippedHorizontally (uint32_t gid)
 
bool IsFlippedVertically (uint32_t gid)
 
bool IsFlippedDiagonally (uint32_t gid)
 
ResolvedGid ResolveGid (const TiledMap &map, uint32_t gid)
 
std::vector< std::string > GetAllImagePaths (const TiledMap &map)
 
static std::string GetPadding (int totalWidth, const std::string &content)
 

Variables

constexpr uint32_t FLIPPED_HORIZONTALLY_FLAG = 0x80000000
 
constexpr uint32_t FLIPPED_VERTICALLY_FLAG = 0x40000000
 
constexpr uint32_t FLIPPED_DIAGONALLY_FLAG = 0x20000000
 
constexpr uint32_t TILE_ID_MASK = 0x1FFFFFFF
 

Typedef Documentation

◆ json

Definition at line 17 of file TiledJsonHelper.h.

Enumeration Type Documentation

◆ LayerType

Enumerator
TileLayer 
ObjectGroup 
ImageLayer 
Group 

Definition at line 117 of file TiledStructures.h.

◆ MapOrientation

Enumerator
Orthogonal 
Isometric 
Staggered 
Hexagonal 

Definition at line 318 of file TiledStructures.h.

◆ ObjectType

Enumerator
Rectangle 
Ellipse 
Point 
Polygon 
Polyline 
Text 

Definition at line 126 of file TiledStructures.h.

◆ PropertyType

Enumerator
String 
Int 
Float 
Bool 
Color 
File 
Object 

Definition at line 42 of file TiledStructures.h.

◆ RenderOrder

Enumerator
RightDown 
RightUp 
LeftDown 
LeftUp 

Definition at line 340 of file TiledStructures.h.

Function Documentation

◆ ColorToString()

std::string Olympe::Tiled::ColorToString ( int  color)
inline

Definition at line 122 of file TiledJsonHelper.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetAllImagePaths()

std::vector< std::string > Olympe::Tiled::GetAllImagePaths ( const TiledMap map)
inline

Definition at line 493 of file TiledStructures.h.

References GetComponentTypeID_Static(), Group, and ImageLayer.

+ Here is the call graph for this function:

◆ GetArray()

json Olympe::Tiled::GetArray ( const json j,
const std::string &  key 
)
inline

Definition at line 65 of file TiledJsonHelper.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetArraySize()

size_t Olympe::Tiled::GetArraySize ( const json j)
inline

Definition at line 89 of file TiledJsonHelper.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetBool()

bool Olympe::Tiled::GetBool ( const json j,
const std::string &  key,
bool  defaultValue = false 
)
inline

◆ GetDouble()

double Olympe::Tiled::GetDouble ( const json j,
const std::string &  key,
double  defaultValue = 0.0 
)
inline

Definition at line 47 of file TiledJsonHelper.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetFloat()

float Olympe::Tiled::GetFloat ( const json j,
const std::string &  key,
float  defaultValue = 0.0f 
)
inline

◆ GetInt()

int Olympe::Tiled::GetInt ( const json j,
const std::string &  key,
int  defaultValue = 0 
)
inline

◆ GetObject()

json Olympe::Tiled::GetObject ( const json j,
const std::string &  key 
)
inline

Definition at line 74 of file TiledJsonHelper.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetPadding()

static std::string Olympe::Tiled::GetPadding ( int  totalWidth,
const std::string &  content 
)
static

Definition at line 23 of file LevelParser.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetString()

std::string Olympe::Tiled::GetString ( const json j,
const std::string &  key,
const std::string &  defaultValue = "" 
)
inline

◆ GetTileId()

uint32_t Olympe::Tiled::GetTileId ( uint32_t  gid)
inline

◆ HasKey()

bool Olympe::Tiled::HasKey ( const json j,
const std::string &  key 
)
inline

◆ IsFlippedDiagonally()

bool Olympe::Tiled::IsFlippedDiagonally ( uint32_t  gid)
inline

Definition at line 453 of file TiledStructures.h.

References FLIPPED_DIAGONALLY_FLAG.

Referenced by Olympe::Tiled::anonymous_namespace{TiledToOlympe.cpp}::ExtractFlipFlags(), and ResolveGid().

+ Here is the caller graph for this function:

◆ IsFlippedHorizontally()

bool Olympe::Tiled::IsFlippedHorizontally ( uint32_t  gid)
inline

Definition at line 443 of file TiledStructures.h.

References FLIPPED_HORIZONTALLY_FLAG.

Referenced by Olympe::Tiled::anonymous_namespace{TiledToOlympe.cpp}::ExtractFlipFlags(), and ResolveGid().

+ Here is the caller graph for this function:

◆ IsFlippedVertically()

bool Olympe::Tiled::IsFlippedVertically ( uint32_t  gid)
inline

Definition at line 448 of file TiledStructures.h.

References FLIPPED_VERTICALLY_FLAG.

Referenced by Olympe::Tiled::anonymous_namespace{TiledToOlympe.cpp}::ExtractFlipFlags(), and ResolveGid().

+ Here is the caller graph for this function:

◆ operator<<()

std::ostream & Olympe::Tiled::operator<< ( std::ostream &  os,
MapOrientation  orientation 
)
inline

Definition at line 327 of file TiledStructures.h.

References GetComponentTypeID_Static(), Hexagonal, Isometric, Orthogonal, and Staggered.

+ Here is the call graph for this function:

◆ ParseColor()

int Olympe::Tiled::ParseColor ( const std::string &  colorStr)
inline

Definition at line 98 of file TiledJsonHelper.h.

References GetComponentTypeID_Static().

Referenced by Olympe::Tiled::TiledLevelLoader::ParseLayer(), and Olympe::Tiled::TiledLevelLoader::ParseLayerXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseLayerProperties()

LayerProperties Olympe::Tiled::ParseLayerProperties ( const std::map< std::string, TiledProperty > &  properties)
inline

Definition at line 80 of file TiledStructures.h.

References Bool, GetComponentTypeID_Static(), and Olympe::Tiled::LayerProperties::hasNavigationProperties.

Referenced by World::GenerateCollisionAndNavigationMaps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResolveGid()

ResolvedGid Olympe::Tiled::ResolveGid ( const TiledMap map,
uint32_t  gid 
)
inline

Variable Documentation

◆ FLIPPED_DIAGONALLY_FLAG

constexpr uint32_t Olympe::Tiled::FLIPPED_DIAGONALLY_FLAG = 0x20000000
constexpr

Definition at line 29 of file TiledStructures.h.

Referenced by IsFlippedDiagonally().

◆ FLIPPED_HORIZONTALLY_FLAG

constexpr uint32_t Olympe::Tiled::FLIPPED_HORIZONTALLY_FLAG = 0x80000000
constexpr

Definition at line 27 of file TiledStructures.h.

Referenced by IsFlippedHorizontally().

◆ FLIPPED_VERTICALLY_FLAG

constexpr uint32_t Olympe::Tiled::FLIPPED_VERTICALLY_FLAG = 0x40000000
constexpr

Definition at line 28 of file TiledStructures.h.

Referenced by IsFlippedVertically().

◆ TILE_ID_MASK

constexpr uint32_t Olympe::Tiled::TILE_ID_MASK = 0x1FFFFFFF
constexpr