#ifndef _STAGE_H_ #define _STAGE_H_ #include #include #define AKGL_STAGE_PARTITION_HORIZONTAL 0 #define AKGL_STAGE_PARTITION_VERTICAL 1 #define AKGL_STAGE_PARTITION_MAXDEPTH 4 // Stages are collections of lights and cameras in a 2D or 3D space wherein actors // and backgrounds are placed and directed for action. typedef struct akgl_Stage { aksl_TreeNode bsp; akerr_ErrorContext AKERR_NOIGNORE *(*partition)(struct akgl_Stage *self); akerr_ErrorContext AKERR_NOIGNORE *(*partition_actor)(struct akgl_Stage *self, akgl_Actor *actor); } akgl_Stage; typedef struct akgl_BSPContext { aksl_TreeNode *left; aksl_TreeNode *right; aksl_TreeNode *parent; } akgl_BSPContext; typedef struct akgl_BSPLeaf { SDL_FRect extent; aksl_ListNode *actors; } akerr_ErrorContext AKERR_NOIGNORE *akgl_stage_2d(akgl_Stage *self); // A function to divide the stage into a binary space partition tree with lists of actors in each partition akerr_ErrorContext AKERR_NOIGNORE *akgl_stage_2d_partition(akgl_Stage *self); #endif // _STAGE_H_