load map first pass
This commit is contained in:
@@ -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();
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user