Add inventory.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include "ui/uitext.h"
|
||||
#include "display/screen.h"
|
||||
#include "display/spritebatch.h"
|
||||
#include "rpg/entity/entity.h"
|
||||
// #include "rpg/entity/entity.h"
|
||||
|
||||
bool_t UI_DEBUG_DRAW = true;
|
||||
|
||||
@@ -67,32 +67,32 @@ void uiDebugRender(const tileset_t *tileset, texture_t *texture) {
|
||||
|
||||
|
||||
// Player position
|
||||
entity_t *player = NULL;
|
||||
for(uint8_t i = 0; i < ENTITY_COUNT; i++) {
|
||||
if(ENTITIES[i].type != ENTITY_TYPE_PLAYER) continue;
|
||||
player = &ENTITIES[i];
|
||||
break;
|
||||
}
|
||||
if(player == NULL) {
|
||||
snprintf(buffer, sizeof(buffer), "Player: N/A");
|
||||
} else {
|
||||
snprintf(
|
||||
buffer,
|
||||
sizeof(buffer),
|
||||
"%d,%d,%d/%d/%d",
|
||||
player->position.x,
|
||||
player->position.y,
|
||||
player->position.z,
|
||||
(int32_t)player->direction,
|
||||
(int32_t)player->animation
|
||||
);
|
||||
}
|
||||
uiTextMeasure(buffer, tileset, &w, &h);
|
||||
uiTextDraw(
|
||||
SCREEN.width - w, hOffset,
|
||||
buffer, COLOR_GREEN, tileset, texture
|
||||
);
|
||||
hOffset += h;
|
||||
// entity_t *player = NULL;
|
||||
// for(uint8_t i = 0; i < ENTITY_COUNT; i++) {
|
||||
// if(ENTITIES[i].type != ENTITY_TYPE_PLAYER) continue;
|
||||
// player = &ENTITIES[i];
|
||||
// break;
|
||||
// }
|
||||
// if(player == NULL) {
|
||||
// snprintf(buffer, sizeof(buffer), "Player: N/A");
|
||||
// } else {
|
||||
// snprintf(
|
||||
// buffer,
|
||||
// sizeof(buffer),
|
||||
// "%d,%d,%d/%d/%d",
|
||||
// player->position.x,
|
||||
// player->position.y,
|
||||
// player->position.z,
|
||||
// (int32_t)player->direction,
|
||||
// (int32_t)player->animation
|
||||
// );
|
||||
// }
|
||||
// uiTextMeasure(buffer, tileset, &w, &h);
|
||||
// uiTextDraw(
|
||||
// SCREEN.width - w, hOffset,
|
||||
// buffer, COLOR_GREEN, tileset, texture
|
||||
// );
|
||||
// hOffset += h;
|
||||
|
||||
spriteBatchFlush();
|
||||
}
|
||||
Reference in New Issue
Block a user