Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
ECS_Systems.cpp File Reference
#include "ECS_Systems.h"
#include "ECS_Components.h"
#include "ECS_Entity.h"
#include "World.h"
#include "GameEngine.h"
#include "InputsManager.h"
#include "InputDevice.h"
#include "system/KeyboardManager.h"
#include "system/JoystickManager.h"
#include "system/ViewportManager.h"
#include "system/EventQueue.h"
#include "VideoGame.h"
+ Include dependency graph for ECS_Systems.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{ECS_Systems.cpp}
 

Functions

void ExtractFlipFlags (uint32_t gid, bool &flipH, bool &flipV, bool &flipD)
 
SDL_FlipMode GetSDLFlip (bool flipH, bool flipV, bool)
 
void GetVisibleTileRange (const CameraTransform &cam, const std::string &orientation, int tileWidth, int tileHeight, int &minX, int &minY, int &maxX, int &maxY)
 
float CalculateTileDepth (const std::string &orientation, int worldX, int worldY, int layerZOrder, int tileWidth, int tileHeight)
 
float CalculateEntityDepth (const std::string &orientation, const Vector &position, int tileWidth, int tileHeight)
 
void RenderTileImmediate (SDL_Texture *texture, const SDL_Rect &srcRect, int worldX, int worldY, uint32_t gid, int tileoffsetX, int tileoffsetY, const CameraTransform &cam, const std::string &orientation, int tileWidth, int tileHeight)
 
void RenderMultiLayerForCamera (const CameraTransform &cam)
 
void RenderSingleEntity (const CameraTransform &cam, EntityID entity)
 
void RenderEntitiesForCamera (const CameraTransform &cam)
 

Variables

constexpr float anonymous_namespace{ECS_Systems.cpp}::DEPTH_LAYER_SCALE = 10000.0f
 
constexpr float anonymous_namespace{ECS_Systems.cpp}::DEPTH_DIAGONAL_SCALE = 100.0f
 
constexpr float anonymous_namespace{ECS_Systems.cpp}::DEPTH_X_SCALE = 0.1f
 
constexpr int anonymous_namespace{ECS_Systems.cpp}::ISO_TILE_PADDING = 5
 
constexpr int anonymous_namespace{ECS_Systems.cpp}::ORTHO_TILE_PADDING = 2
 

Function Documentation

◆ CalculateEntityDepth()

float CalculateEntityDepth ( const std::string orientation,
const Vector position,
int  tileWidth,
int  tileHeight 
)

Definition at line 743 of file ECS_Systems.cpp.

References anonymous_namespace{ECS_Systems.cpp}::DEPTH_LAYER_SCALE, GetComponentTypeID_Static(), Vector::y, and Vector::z.

Referenced by RenderMultiLayerForCamera().

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

◆ CalculateTileDepth()

float CalculateTileDepth ( const std::string orientation,
int  worldX,
int  worldY,
int  layerZOrder,
int  tileWidth,
int  tileHeight 
)

◆ ExtractFlipFlags()

void ExtractFlipFlags ( uint32_t  gid,
bool flipH,
bool flipV,
bool flipD 
)

Definition at line 636 of file ECS_Systems.cpp.

References GetComponentTypeID_Static().

Referenced by Olympe::Tiled::TiledToOlympe::ProcessGroupLayers(), Olympe::Tiled::TiledToOlympe::ProcessVisualLayers(), and RenderTileImmediate().

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

◆ GetSDLFlip()

SDL_FlipMode GetSDLFlip ( bool  flipH,
bool  flipV,
bool   
)

Definition at line 650 of file ECS_Systems.cpp.

References GetComponentTypeID_Static().

Referenced by RenderTileImmediate().

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

◆ GetVisibleTileRange()

void GetVisibleTileRange ( const CameraTransform cam,
const std::string orientation,
int  tileWidth,
int  tileHeight,
int minX,
int minY,
int maxX,
int maxY 
)

Definition at line 659 of file ECS_Systems.cpp.

References GetComponentTypeID_Static(), anonymous_namespace{ECS_Systems.cpp}::ISO_TILE_PADDING, and anonymous_namespace{ECS_Systems.cpp}::ORTHO_TILE_PADDING.

Referenced by RenderMultiLayerForCamera().

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

◆ RenderEntitiesForCamera()

void RenderEntitiesForCamera ( const CameraTransform cam)

◆ RenderMultiLayerForCamera()

void RenderMultiLayerForCamera ( const CameraTransform cam)

◆ RenderSingleEntity()

void RenderSingleEntity ( const CameraTransform cam,
EntityID  entity 
)

Definition at line 1096 of file ECS_Systems.cpp.

References BoundingBox_data::boundingBox, CollisionZone_data::bounds, Draw_FilledCircle(), Draw_Rectangle(), Draw_Text(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), GameEngine::renderer, and Vector::x.

Referenced by RenderMultiLayerForCamera().

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

◆ RenderTileImmediate()

void RenderTileImmediate ( SDL_Texture texture,
const SDL_Rect srcRect,
int  worldX,
int  worldY,
uint32_t  gid,
int  tileoffsetX,
int  tileoffsetY,
const CameraTransform cam,
const std::string orientation,
int  tileWidth,
int  tileHeight 
)

Definition at line 761 of file ECS_Systems.cpp.

References ExtractFlipFlags(), GetComponentTypeID_Static(), GetSDLFlip(), GameEngine::renderer, Vector::x, and Vector::y.

Referenced by RenderMultiLayerForCamera().

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