![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <IsometricRenderer.h>
Public Member Functions | |
| IsometricRenderer () | |
| ~IsometricRenderer () | |
| void | Initialize (SDL_Renderer *renderer, int tileWidth, int tileHeight) |
| void | SetCamera (float camX, float camY, float zoom) |
| void | SetViewport (int screenWidth, int screenHeight) |
| Vector | WorldToScreen (float worldX, float worldY) const |
| Vector | ScreenToWorld (float screenX, float screenY) const |
| bool | IsTileVisible (int worldX, int worldY) const |
| void | GetVisibleTileRange (int &minX, int &minY, int &maxX, int &maxY) const |
Private Member Functions | |
| float | CalculateCullingMargin () const |
Private Attributes | |
| SDL_Renderer * | m_renderer |
| int | m_tileWidth |
| int | m_tileHeight |
| float | m_cameraX |
| float | m_cameraY |
| float | m_zoom |
| int | m_screenWidth |
| int | m_screenHeight |
Static Private Attributes | |
| static constexpr float | ISOMETRIC_OFFSET_Y = 200.0f |
| static constexpr float | CULL_MARGIN = 100.0f |
| static constexpr float | TALL_TILE_MULTIPLIER = 5.0f |
| static constexpr int | VISIBLE_TILE_PADDING = 5 |
Definition at line 27 of file IsometricRenderer.h.
| Olympe::Rendering::IsometricRenderer::IsometricRenderer | ( | ) |
Definition at line 18 of file IsometricRenderer.cpp.
| Olympe::Rendering::IsometricRenderer::~IsometricRenderer | ( | ) |
Definition at line 30 of file IsometricRenderer.cpp.
|
private |
Definition at line 131 of file IsometricRenderer.cpp.
References CULL_MARGIN, GetComponentTypeID_Static(), m_tileHeight, m_tileWidth, m_zoom, and TALL_TILE_MULTIPLIER.
Referenced by IsTileVisible().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::Rendering::IsometricRenderer::GetVisibleTileRange | ( | int & | minX, |
| int & | minY, | ||
| int & | maxX, | ||
| int & | maxY | ||
| ) | const |
Definition at line 110 of file IsometricRenderer.cpp.
References GetComponentTypeID_Static(), m_screenHeight, m_screenWidth, ScreenToWorld(), and VISIBLE_TILE_PADDING.
Here is the call graph for this function:| void Olympe::Rendering::IsometricRenderer::Initialize | ( | SDL_Renderer * | renderer, |
| int | tileWidth, | ||
| int | tileHeight | ||
| ) |
Definition at line 34 of file IsometricRenderer.cpp.
References m_renderer, m_tileHeight, m_tileWidth, renderer, and SYSTEM_LOG.
Definition at line 95 of file IsometricRenderer.cpp.
References CalculateCullingMargin(), GetComponentTypeID_Static(), m_screenHeight, m_screenWidth, and WorldToScreen().
Here is the call graph for this function:Definition at line 77 of file IsometricRenderer.cpp.
References GetComponentTypeID_Static(), ISOMETRIC_OFFSET_Y, m_cameraX, m_cameraY, m_screenHeight, m_screenWidth, m_tileHeight, m_tileWidth, m_zoom, Vector::x, Vector::y, and Vector::z.
Referenced by GetVisibleTileRange().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 44 of file IsometricRenderer.cpp.
References GetComponentTypeID_Static(), m_cameraX, m_cameraY, and m_zoom.
Here is the call graph for this function:Definition at line 51 of file IsometricRenderer.cpp.
References m_screenHeight, and m_screenWidth.
Definition at line 57 of file IsometricRenderer.cpp.
References GetComponentTypeID_Static(), ISOMETRIC_OFFSET_Y, m_cameraX, m_cameraY, m_screenHeight, m_screenWidth, m_tileHeight, m_tileWidth, m_zoom, and Vector::x.
Referenced by IsTileVisible().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 66 of file IsometricRenderer.h.
Referenced by CalculateCullingMargin().
|
staticconstexprprivate |
Definition at line 65 of file IsometricRenderer.h.
Referenced by ScreenToWorld(), and WorldToScreen().
|
private |
Definition at line 56 of file IsometricRenderer.h.
Referenced by ScreenToWorld(), SetCamera(), and WorldToScreen().
|
private |
Definition at line 57 of file IsometricRenderer.h.
Referenced by ScreenToWorld(), SetCamera(), and WorldToScreen().
|
private |
Definition at line 49 of file IsometricRenderer.h.
Referenced by Initialize().
|
private |
Definition at line 62 of file IsometricRenderer.h.
Referenced by GetVisibleTileRange(), IsTileVisible(), ScreenToWorld(), SetViewport(), and WorldToScreen().
|
private |
Definition at line 61 of file IsometricRenderer.h.
Referenced by GetVisibleTileRange(), IsTileVisible(), ScreenToWorld(), SetViewport(), and WorldToScreen().
|
private |
Definition at line 53 of file IsometricRenderer.h.
Referenced by CalculateCullingMargin(), Initialize(), ScreenToWorld(), and WorldToScreen().
|
private |
Definition at line 52 of file IsometricRenderer.h.
Referenced by CalculateCullingMargin(), Initialize(), ScreenToWorld(), and WorldToScreen().
|
private |
Definition at line 58 of file IsometricRenderer.h.
Referenced by CalculateCullingMargin(), ScreenToWorld(), SetCamera(), and WorldToScreen().
|
staticconstexprprivate |
Definition at line 67 of file IsometricRenderer.h.
Referenced by CalculateCullingMargin().
Definition at line 68 of file IsometricRenderer.h.
Referenced by GetVisibleTileRange().