load map first pass

This commit is contained in:
2025-09-19 12:43:57 -05:00
parent 2f40724258
commit 061352bcff
14 changed files with 256 additions and 52 deletions

View File

@@ -37,9 +37,11 @@ errorret_t sceneOverworldInit(void) {
}
void sceneOverworldUpdate(void) {
if(RPG.map == NULL) return;
// Move camera to player.
const entity_t *start = &testMap.entities[0];
const entity_t *end = &testMap.entities[testMap.entityCount];
const entity_t *start = &RPG.map->entities[0];
const entity_t *end = &RPG.map->entities[RPG.map->entityCount];
while(start < end) {
if(start->type == ENTITY_TYPE_PLAYER) {
SCENE_OVERWORLD.camera.lookat.target[0] = start->position[0];
@@ -70,7 +72,7 @@ void sceneOverworldRender(void) {
cameraPushMatrix(&SCENE_OVERWORLD.camera);
sceneOverworldRenderMap(&testMap);
if(RPG.map != NULL) sceneOverworldRenderMap(RPG.map);
spriteBatchFlush();
cameraPopMatrix();

View File

@@ -7,7 +7,7 @@
#pragma once
#include "display/camera.h"
#include "rpg/world/map.h"
#include "rpg/rpg.h"
#include "error/error.h"
typedef struct {