Add inventory.
All checks were successful
Build Dusk / run-tests (push) Successful in 2m12s
Build Dusk / build-linux (push) Successful in 1m49s
Build Dusk / build-psp (push) Successful in 1m52s

This commit is contained in:
2026-01-06 07:47:16 -06:00
parent 024ace1078
commit af5bf987c8
91 changed files with 1108 additions and 139 deletions

66
archive/rpg/rpg.c Normal file
View File

@@ -0,0 +1,66 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "rpg.h"
#include "entity/entity.h"
#include "rpg/overworld/map.h"
#include "rpg/cutscene/cutscenesystem.h"
#include "time/time.h"
#include "rpgcamera.h"
#include "rpgtextbox.h"
#include "util/memory.h"
#include "assert/assert.h"
errorret_t rpgInit(void) {
memoryZero(ENTITIES, sizeof(ENTITIES));
// Init cutscene subsystem
cutsceneSystemInit();
errorChain(mapInit());
rpgCameraInit();
rpgTextboxInit();
// TEST: Create some entities.
// uint8_t entIndex = entityGetAvailable();
// assertTrue(entIndex != 0xFF, "No available entity slots!.");
// entity_t *ent = &ENTITIES[entIndex];
// entityInit(ent, ENTITY_TYPE_PLAYER);
// RPG_CAMERA.mode = RPG_CAMERA_MODE_FOLLOW_ENTITY;
// RPG_CAMERA.followEntity.followEntityId = ent->id;
// ent->position.x = 2, ent->position.y = 2;
// All Good!
errorOk();
}
errorret_t rpgUpdate(void) {
#if TIME_FIXED == 0
if(TIME.dynamicUpdate) {
errorOk();
}
#endif
// TODO: Do not update if the scene is not the map scene?
mapUpdate();
// Update overworld ents.
entity_t *ent = &ENTITIES[0];
do {
if(ent->type == ENTITY_TYPE_NULL) continue;
entityUpdate(ent);
} while(++ent < &ENTITIES[ENTITY_COUNT]);
cutsceneSystemUpdate();
errorChain(rpgCameraUpdate());
errorOk();
}
void rpgDispose(void) {
mapDispose();
}