Stardew Engine
Loading...
Searching...
No Matches
WfPlayer.h File Reference
#include <cglm/cglm.h>
#include "WfEnums.h"
#include "InputContext.h"
Include dependency graph for WfPlayer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  WfAnimationSetLayer
 A set of animations for everything the player can do. More...
 
struct  WfAnimationSet
 A set of anumations drawn behind and in front of the base sprite. More...
 
struct  WfPlayerEntData
 

Macros

#define NUM_ANIMATIONS   NumDirections
 
#define PLAYER_SPRITE_COMP_INDEX   3
 
#define PLAYER_BG_SPRITE_COMP_START   1
 
#define PLAYER_NUM_BG_SPRITES   2
 
#define PLAYER_COLLIDER_COMP_INDEX   0
 

Enumerations

enum  WfAnimationLayerNames {
  WfHairAnimationLayer , WfTorsoAnimationLayer , WfLegAnimationLayer , WfToolAnimationLayer ,
  WfNumAnimationLayers
}
 
enum  WfBGAnimationLayerNames { WfBG1 , WfBG2 , WfNumBackgroundAnimationLayers }
 
enum  WfPlayerState { WfWalking , WfAttacking , WfNumPlayerStates }
 
enum  WfPlayerDirection { WfPD_Up = 1 , WfPD_Down = (1 << 1) , WfPD_Left = (1 << 2) , WfPD_Right = (1 << 3) }
 

Functions

void WfInitPlayer ()
 
struct WfAnimationSetWfGetPlayerAnimationSet (struct Entity2D *pInPlayerEnt)
 
void WfSetPlayerAnimationSet (struct Entity2D *pInPlayerEnt, const struct WfAnimationSet *pInSet)
 
void WfDeSerializePlayerEntity (struct BinarySerializer *bs, struct Entity2D *pOutEnt, struct GameLayer2DData *pData)
 
void WfSerializePlayerEntity (struct BinarySerializer *bs, struct Entity2D *pInEnt, struct GameLayer2DData *pData)
 
void WfMakeIntoPlayerEntity (struct Entity2D *pInEnt, struct GameFrameworkLayer *pLayer, vec2 spawnAtGroundPos)
 
struct WfPlayerEntDataWfGetPlayerEntData (struct Entity2D *pInEnt)
 
struct Component2DWfGetPlayerAnimationLayerComponent (struct Entity2D *pPlayer, enum WfAnimationLayerNames layer)
 
void WfSetPlayerOverlayAnimations (enum WfDirection dir, struct GameFrameworkLayer *pLayer, struct WfPlayerEntData *pPlayerEntData, struct Entity2D *pEnt)
 
void WfPlayerGetGroundContactPoint (struct Entity2D *pEnt, vec2 outPos)
 

Macro Definition Documentation

◆ NUM_ANIMATIONS

#define NUM_ANIMATIONS   NumDirections

◆ PLAYER_BG_SPRITE_COMP_START

#define PLAYER_BG_SPRITE_COMP_START   1

◆ PLAYER_COLLIDER_COMP_INDEX

#define PLAYER_COLLIDER_COMP_INDEX   0

◆ PLAYER_NUM_BG_SPRITES

#define PLAYER_NUM_BG_SPRITES   2

◆ PLAYER_SPRITE_COMP_INDEX

#define PLAYER_SPRITE_COMP_INDEX   3

Enumeration Type Documentation

◆ WfAnimationLayerNames

Enumerator
WfHairAnimationLayer 
WfTorsoAnimationLayer 
WfLegAnimationLayer 
WfToolAnimationLayer 
WfNumAnimationLayers 

◆ WfBGAnimationLayerNames

Enumerator
WfBG1 
WfBG2 
WfNumBackgroundAnimationLayers 

◆ WfPlayerDirection

Enumerator
WfPD_Up 
WfPD_Down 
WfPD_Left 
WfPD_Right 

◆ WfPlayerState

Enumerator
WfWalking 
WfAttacking 
WfNumPlayerStates 

Function Documentation

◆ WfDeSerializePlayerEntity()

void WfDeSerializePlayerEntity ( struct BinarySerializer bs,
struct Entity2D pOutEnt,
struct GameLayer2DData pData 
)

◆ WfGetPlayerAnimationLayerComponent()

struct Component2D * WfGetPlayerAnimationLayerComponent ( struct Entity2D pPlayer,
enum WfAnimationLayerNames  layer 
)

◆ WfGetPlayerAnimationSet()

struct WfAnimationSet * WfGetPlayerAnimationSet ( struct Entity2D pInPlayerEnt)

◆ WfGetPlayerEntData()

struct WfPlayerEntData * WfGetPlayerEntData ( struct Entity2D pInEnt)

◆ WfInitPlayer()

void WfInitPlayer ( )

◆ WfMakeIntoPlayerEntity()

void WfMakeIntoPlayerEntity ( struct Entity2D pInEnt,
struct GameFrameworkLayer pLayer,
vec2  spawnAtGroundPos 
)

◆ WfPlayerGetGroundContactPoint()

void WfPlayerGetGroundContactPoint ( struct Entity2D pEnt,
vec2  outPos 
)

◆ WfSerializePlayerEntity()

void WfSerializePlayerEntity ( struct BinarySerializer bs,
struct Entity2D pInEnt,
struct GameLayer2DData pData 
)

◆ WfSetPlayerAnimationSet()

void WfSetPlayerAnimationSet ( struct Entity2D pInPlayerEnt,
const struct WfAnimationSet pInSet 
)

◆ WfSetPlayerOverlayAnimations()

void WfSetPlayerOverlayAnimations ( enum WfDirection  dir,
struct GameFrameworkLayer pLayer,
struct WfPlayerEntData pPlayerEntData,
struct Entity2D pEnt 
)