File Game2DLayer.h

FileList > engine > include > Game2DLayer.h

Go to the source code of this file

  • #include "IntTypes.h"
  • #include "DynArray.h"
  • #include "HandleDefs.h"
  • #include <cglm/cglm.h>
  • #include "InputContext.h"
  • #include "FreeLookCameraMode.h"
  • #include "Entity2DCollection.h"
  • #include "TimerPool.h"

Classes

Type Name
struct Game2DLayerOptions
struct GameLayer2DData
struct TileMap
struct TileMapLayer
struct Transform2D

Public Types

Type Name
typedef struct DrawContext DrawContext
typedef struct InputMapping InputMapping
typedef void(* LevelDataHandlerExtenderFn
typedef void(* LevelDataPacketExtenderFn
Extend the writing of the level data packet that servers send to clients.
typedef void(* LevelDataRequestHandlerExtenderFn
enum ObjectLayer2DDrawOrder
typedef void(* PreFirstInitFn
typedef void(* PreLoadLevelFn

Public Attributes

Type Name
struct Entity2DCollection * pCollection
struct Entity2DCollection vec2 vec2 regionBR
struct Entity2DCollection vec2 regionTL

Public Functions

Type Name
void Et2D_Transform2DToMat3 (struct Transform2D * pTrans, mat3 out)
convert a transform2D to a matrix
void G2D_SaveLevelDataInternal (struct GameLayer2DData * pData, struct BinarySerializer * pBS)
void Game2DLayer_Get (struct GameFrameworkLayer * pLayer, struct Game2DLayerOptions * pOptions, DrawContext * pDC)
void Game2DLayer_OnPop (struct GameFrameworkLayer * pLayer, DrawContext * drawContext, InputContext * inputContext)
void Game2DLayer_SaveLevelFile (struct GameLayer2DData * pData, const char * outputFilePath)
void GameLayer2D_OnPush (struct GameFrameworkLayer * pLayer, DrawContext * drawContext, InputContext * inputContext)
void TilemapLayer_GetTLBR (vec2 tl, vec2 br, struct TileMapLayer * pTMLayer)
VECTOR (HEntity2D)
Query which dynamic entities are in a given region (their bounding boxes intersect with the region)

Macros

Type Name
define MAX_GAME_LAYER_ASSET_FILE_PATH_LEN 128

Public Types Documentation

typedef DrawContext

typedef struct DrawContext DrawContext;

typedef InputMapping

typedef struct InputMapping InputMapping;

typedef LevelDataHandlerExtenderFn

typedef void(* LevelDataHandlerExtenderFn) (struct GameLayer2DData *pGameLayerData, struct BinarySerializer *pBS);

typedef LevelDataPacketExtenderFn

Extend the writing of the level data packet that servers send to clients.

typedef void(* LevelDataPacketExtenderFn) (struct GameLayer2DData *pGameLayerData, struct BinarySerializer *pBS);

typedef LevelDataRequestHandlerExtenderFn

typedef void(* LevelDataRequestHandlerExtenderFn) (struct GameLayer2DData *pGameLayerData, struct BinarySerializer *pBS);
  • Extend the handling of a level data request packet that the server reciever
  • the client can send extra data by extending the G2D_Enqueue_RequestLevelData function by calling G2D_Extend_RequestLevelDataMessage and registering an extender

enum ObjectLayer2DDrawOrder

enum ObjectLayer2DDrawOrder {
    DrawOrder_TopDown,
    DrawOrder_Index
};

typedef PreFirstInitFn

typedef void(* PreFirstInitFn) (struct GameLayer2DData *pGameLayerData);

typedef PreLoadLevelFn

typedef void(* PreLoadLevelFn) (struct GameLayer2DData *pGameLayerData);

Public Attributes Documentation

variable pCollection

struct Entity2DCollection* pCollection;

variable regionBR

struct Entity2DCollection vec2 vec2 regionBR;

variable regionTL

struct Entity2DCollection vec2 regionTL;

Public Functions Documentation

function Et2D_Transform2DToMat3

convert a transform2D to a matrix

void Et2D_Transform2DToMat3 (
    struct Transform2D * pTrans,
    mat3 out
) 

Parameters:

  • pTrans input transform
  • out output matrix

function G2D_SaveLevelDataInternal

void G2D_SaveLevelDataInternal (
    struct GameLayer2DData * pData,
    struct BinarySerializer * pBS
) 

Parameters:

  • pData
  • pBS

function Game2DLayer_Get

void Game2DLayer_Get (
    struct GameFrameworkLayer * pLayer,
    struct Game2DLayerOptions * pOptions,
    DrawContext * pDC
) 

function Game2DLayer_OnPop

void Game2DLayer_OnPop (
    struct GameFrameworkLayer * pLayer,
    DrawContext * drawContext,
    InputContext * inputContext
) 

function Game2DLayer_SaveLevelFile

void Game2DLayer_SaveLevelFile (
    struct GameLayer2DData * pData,
    const char * outputFilePath
) 

function GameLayer2D_OnPush

void GameLayer2D_OnPush (
    struct GameFrameworkLayer * pLayer,
    DrawContext * drawContext,
    InputContext * inputContext
) 

function TilemapLayer_GetTLBR

void TilemapLayer_GetTLBR (
    vec2 tl,
    vec2 br,
    struct TileMapLayer * pTMLayer
) 

function VECTOR

Query which dynamic entities are in a given region (their bounding boxes intersect with the region)

VECTOR (
    HEntity2D
) 

Parameters:

  • pLayer
  • pCollection
  • regionTL
  • regionBR
  • pOutEntities

Returns:


Macro Definition Documentation

define MAX_GAME_LAYER_ASSET_FILE_PATH_LEN

#define MAX_GAME_LAYER_ASSET_FILE_PATH_LEN `128`


The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/engine/include/Game2DLayer.h