Stardew Engine
Loading...
Searching...
No Matches
GameLayer2DData Struct Reference

#include <Game2DLayer.h>

Collaboration diagram for GameLayer2DData:

Public Member Functions

 VECTOR (struct Worldspace2DVert) pWorldspaceVertices
 buffers of vertices and indices populated each frame
 
 VECTOR (VertIndexT) pWorldspaceIndices
 

Data Fields

struct GameFrameworkLayerpLayer
 for convenience, a reference back to the layer
 
HEntity2DQuadtreeNode hEntitiesQuadTree
 The top node of a quad tree that holds references to static sprites for culling.
 
hAtlas hAtlas
 handle to atlas containing sprite data
 
struct TileMap tilemap
 tilemap comprised of a list of tilemap layers
 
bool bLoaded
 mostly pointless
 
bool bFreeLookMode
 When in this mode the game is paused and you have a different set of controls to freely move the camera around, in future I might add editing.
 
struct Transform2D camera
 the one and only camera
 
int cameraClampedToTilemapLayer
 Which layer, if any, is the camera clamped to. If it is not clamped (the default) then this should be -1.
 
struct FreeLookCameraModeControls freeLookCtrls
 controls for free look mode
 
H2DWorldspaceVertexBuffer vertexBuffer
 
char atlasFilePath [MAX_GAME_LAYER_ASSET_FILE_PATH_LEN]
 Path of loaded atlas file.
 
char tilemapFilePath [MAX_GAME_LAYER_ASSET_FILE_PATH_LEN]
 path of loaded level file
 
bool bDebugLayerAttatched
 flag for whether the debug overlay is pushed on top of the game
 
char debugMsg [256]
 A message to display on the screen when the debug overlay is on top of the game2dlayer.
 
struct GameFrameworkEventListenerpDebugListener
 Listens for the debug overlay game framework layer being pushed.
 
int windowW
 Window width.
 
int windowH
 Window height.
 
HPhysicsWorld hPhysicsWorld
 Physics world handle.
 
struct Entity2DCollection entities
 Entities collection.
 
void * pUserData
 Game specific data.
 
PreFirstInitFn preFirstInitCallback
 a callback called when the layer is pushed, and the level and all entities are loaded, but have not had their init methods called yet. An opportunity for your game to load sprite handles from the atlas that the entities will use in their init methods.
 
PreLoadLevelFn preLoadLevelFn
 
DrawContextpDrawContext
 HACK : todo: sort out the availabilty of these draw and input contexts todo: use global getter for draw context.
 
bool bSkipDraw
 
bool bCurrentLocationIsDirty
 Current location has changed in such a way that it needs to be saved, when a new area is moved to or you sleep.
 
LevelDataPacketExtenderFn levelDataPacketExtender
 AS THE SERVER : Write extra game specific data to the level data packet the server sends initially to each client.
 
LevelDataRequestHandlerExtenderFn levelDataRequestHandlerExtender
 AS THE SERVER : Read extra game specific data from the level data request packet the client sends to the server.
 
LevelDataHandlerExtenderFn levelDataHandlerExtender
 AS THE CLIENT : Read extra game specific data the server has written to the initial level data packet.
 

Member Function Documentation

◆ VECTOR() [1/2]

GameLayer2DData::VECTOR ( struct Worldspace2DVert  )

buffers of vertices and indices populated each frame

◆ VECTOR() [2/2]

GameLayer2DData::VECTOR ( VertIndexT  )

Field Documentation

◆ atlasFilePath

char GameLayer2DData::atlasFilePath[MAX_GAME_LAYER_ASSET_FILE_PATH_LEN]

Path of loaded atlas file.

◆ bCurrentLocationIsDirty

bool GameLayer2DData::bCurrentLocationIsDirty

Current location has changed in such a way that it needs to be saved, when a new area is moved to or you sleep.

◆ bDebugLayerAttatched

bool GameLayer2DData::bDebugLayerAttatched

flag for whether the debug overlay is pushed on top of the game

◆ bFreeLookMode

bool GameLayer2DData::bFreeLookMode

When in this mode the game is paused and you have a different set of controls to freely move the camera around, in future I might add editing.

◆ bLoaded

bool GameLayer2DData::bLoaded

mostly pointless

◆ bSkipDraw

bool GameLayer2DData::bSkipDraw

◆ camera

struct Transform2D GameLayer2DData::camera

the one and only camera

◆ cameraClampedToTilemapLayer

int GameLayer2DData::cameraClampedToTilemapLayer

Which layer, if any, is the camera clamped to. If it is not clamped (the default) then this should be -1.

◆ debugMsg

char GameLayer2DData::debugMsg[256]

A message to display on the screen when the debug overlay is on top of the game2dlayer.

◆ entities

struct Entity2DCollection GameLayer2DData::entities

Entities collection.

◆ freeLookCtrls

struct FreeLookCameraModeControls GameLayer2DData::freeLookCtrls

controls for free look mode

◆ hAtlas

hAtlas GameLayer2DData::hAtlas

handle to atlas containing sprite data

◆ hEntitiesQuadTree

HEntity2DQuadtreeNode GameLayer2DData::hEntitiesQuadTree

The top node of a quad tree that holds references to static sprites for culling.

◆ hPhysicsWorld

HPhysicsWorld GameLayer2DData::hPhysicsWorld

Physics world handle.

◆ levelDataHandlerExtender

LevelDataHandlerExtenderFn GameLayer2DData::levelDataHandlerExtender

AS THE CLIENT : Read extra game specific data the server has written to the initial level data packet.

◆ levelDataPacketExtender

LevelDataPacketExtenderFn GameLayer2DData::levelDataPacketExtender

AS THE SERVER : Write extra game specific data to the level data packet the server sends initially to each client.

◆ levelDataRequestHandlerExtender

LevelDataRequestHandlerExtenderFn GameLayer2DData::levelDataRequestHandlerExtender

AS THE SERVER : Read extra game specific data from the level data request packet the client sends to the server.

  • extra data is written by extending the G2D_Enqueue_RequestLevelData function by calling G2D_Extend_RequestLevelDataMessage and registering an extender

◆ pDebugListener

struct GameFrameworkEventListener* GameLayer2DData::pDebugListener

Listens for the debug overlay game framework layer being pushed.

◆ pDrawContext

DrawContext* GameLayer2DData::pDrawContext

HACK : todo: sort out the availabilty of these draw and input contexts todo: use global getter for draw context.

◆ pLayer

struct GameFrameworkLayer* GameLayer2DData::pLayer

for convenience, a reference back to the layer

◆ preFirstInitCallback

PreFirstInitFn GameLayer2DData::preFirstInitCallback

a callback called when the layer is pushed, and the level and all entities are loaded, but have not had their init methods called yet. An opportunity for your game to load sprite handles from the atlas that the entities will use in their init methods.

◆ preLoadLevelFn

PreLoadLevelFn GameLayer2DData::preLoadLevelFn

◆ pUserData

void* GameLayer2DData::pUserData

Game specific data.

◆ tilemap

struct TileMap GameLayer2DData::tilemap

tilemap comprised of a list of tilemap layers

◆ tilemapFilePath

char GameLayer2DData::tilemapFilePath[MAX_GAME_LAYER_ASSET_FILE_PATH_LEN]

path of loaded level file

◆ vertexBuffer

H2DWorldspaceVertexBuffer GameLayer2DData::vertexBuffer

◆ windowH

int GameLayer2DData::windowH

Window height.

◆ windowW

int GameLayer2DData::windowW

Window width.


The documentation for this struct was generated from the following file: