Stage BSP partitioning written. Changes to actors to keep track of their BSP node. Actors traverse the BSP as they move. Miscellanious error code def/usage updates. WIP

This commit is contained in:
2026-06-22 08:18:15 -04:00
parent f4728bf19d
commit 71de95822c
12 changed files with 713 additions and 61 deletions

View File

@@ -1,11 +1,12 @@
#ifndef _AKGL_HEAP_H_
#define _AKGL_HEAP_H_
#include "sprite.h"
#include "actor.h"
#include "character.h"
#include "staticstring.h"
#include <akgl/sprite.h>
#include <akgl/actor.h>
#include <akgl/character.h>
#include <akgl/staticstring.h>
#include <akerror.h>
#include <akstdlib.h>
#ifndef AKGL_MAX_HEAP_ACTOR
#define AKGL_MAX_HEAP_ACTOR 64
@@ -23,7 +24,10 @@
#define AKGL_MAX_HEAP_STRING 256
#endif
#ifndef AKGL_MAX_HEAP_LIST
#define AKGL_MAX_HEAP_LIST AKGL_MAX_HEAP_ACTOR
#define AKGL_MAX_HEAP_LIST (AKGL_MAX_HEAP_ACTOR * 2) + 256
#endif
#ifndef AKGL_MAX_HEAP_TREE
#define AKGL_MAX_HEAP_TREE 32
#endif
extern akgl_Actor HEAP_ACTOR[AKGL_MAX_HEAP_ACTOR];
@@ -32,20 +36,30 @@ extern akgl_SpriteSheet HEAP_SPRITESHEET[AKGL_MAX_HEAP_SPRITESHEET];
extern akgl_Character HEAP_CHARACTER[AKGL_MAX_HEAP_CHARACTER];
extern akgl_String HEAP_STRING[AKGL_MAX_HEAP_STRING];
extern aksl_ListNode HEAP_LIST[AKGL_MAX_HEAP_LIST];
extern aksl_TreeNode HEAP_TREE[AKGL_MAX_HEAP_TREE];
extern akgl_BSPLeaf HEAP_TREE_LEAVES[AKGL_MAX_HEAP_TREE];
extern void *AKGL_LIST_SENTINEL;
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_init();
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_init_list();
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_init_tree();
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_init_actor();
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_next_actor(akgl_Actor **dest);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_next_sprite(akgl_Sprite **dest);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_next_spritesheet(akgl_SpriteSheet **dest);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_next_character(akgl_Character **dest);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_next_string(akgl_String **dest);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_next_list(aksl_ListNode **dest);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_next_tree(aksl_TreeNode **dest);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_release_actor(akgl_Actor *ptr);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_release_sprite(akgl_Sprite *ptr);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_release_spritesheet(akgl_SpriteSheet *ptr);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_release_character(akgl_Character *ptr);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_release_string(akgl_String *ptr);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_release_list(aksl_ListNode *ptr);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_iter_list_release(aksl_ListNode *ptr, void *data);
akerr_ErrorContext AKERR_NOIGNORE *akgl_heap_iter_tree_release(aksl_TreeNode *ptr, void *data);
#endif //_AKGL_HEAP_H_