Ensure linux terminal is still working

This commit is contained in:
2024-10-06 16:43:54 -05:00
parent 45b3cf9478
commit 5444b0b8c7
15 changed files with 58 additions and 21 deletions

View File

@ -17,6 +17,7 @@ target_include_directories(${DAWN_TARGET_NAME}
# Subdirs
add_subdirectory(assert)
add_subdirectory(display)
add_subdirectory(game)
add_subdirectory(rpg)
add_subdirectory(ui)
@ -24,6 +25,4 @@ add_subdirectory(ui)
target_sources(${DAWN_TARGET_NAME}
PRIVATE
input.c
time.c
game.c
)

View File

@ -8,7 +8,7 @@
#include "frame.h"
#include "display/symbol.h"
#include "rpg/world/map.h"
#include "game.h"
#include "game/game.h"
#include "ui/textbox.h"
#include "display/draw/drawshape.h"
@ -24,6 +24,11 @@ void frameInit() {
}
void frameUpdate() {
switch(GAME.state) {
case GAME_STATE_PAUSED:
}
map_t *map = GAME.currentMap;
if(map == NULL) return;

View File

@ -8,7 +8,7 @@
#include "assert/assert.h"
#include "rpg/entity/entitydirection.h"
#include "symbol.h"
#include "time.h"
#include "game/time.h"
char_t symbolGetCharByEntity(const entity_t *ent) {
assertNotNull(ent, "Entity cannot be NULL.");

View File

@ -0,0 +1,13 @@
# Copyright (c) 2024 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Subdirs
# Sources
target_sources(${DAWN_TARGET_NAME}
PRIVATE
time.c
game.c
)

View File

@ -5,8 +5,8 @@
* https://opensource.org/licenses/MIT
*/
#include "game.h"
#include "time.h"
#include "game/game.h"
#include "game/time.h"
#include "input.h"
#include "display/display.h"
#include "rpg/world/maps/testmap.h"
@ -32,14 +32,18 @@ uint8_t gameUpdate(const float_t delta) {
inputUpdate();
switch(GAME.state) {
case GAME_STATE_RUNNING:
case GAME_STATE_INITIAL:
GAME.state = GAME_STATE_OVERWORLD;
break;
case GAME_STATE_OVERWORLD:
textboxUpdate();
if(GAME.currentMap) mapUpdate(GAME.currentMap);
if(inputWasPressed(INPUT_BIND_PAUSE)) GAME.state = GAME_STATE_PAUSED;
break;
case GAME_STATE_PAUSED:
if(inputWasPressed(INPUT_BIND_PAUSE)) GAME.state = GAME_STATE_RUNNING;
if(inputWasPressed(INPUT_BIND_PAUSE)) GAME.state = GAME_STATE_OVERWORLD;
break;
default:

View File

@ -11,8 +11,9 @@
#define GAME_UPDATE_RESULT_CONTINUE 0
#define GAME_UPDATE_RESULT_EXIT 1
#define GAME_STATE_RUNNING 0
#define GAME_STATE_PAUSED 1
#define GAME_STATE_INITIAL 0
#define GAME_STATE_OVERWORLD 1
#define GAME_STATE_PAUSED 2
typedef struct {
map_t *currentMap;

View File

@ -5,7 +5,7 @@
* https://opensource.org/licenses/MIT
*/
#include "time.h"
#include "game/time.h"
#include "assert/assert.h"
dawntime_t TIME;

View File

@ -9,7 +9,7 @@
#include "entitydirection.h"
#include "rpg/world/map.h"
#include "assert/assert.h"
#include "time.h"
#include "game/time.h"
#include "ui/textbox.h"
void entityInit(

View File

@ -12,7 +12,7 @@
#include "input.h"
#include "assert/assert.h"
#include "ui/textbox.h"
#include "game.h"
#include "game/game.h"
void playerInit(entity_t *entity) {
assertTrue(entity->type == ENTITY_TYPE_PLAYER, "Entity is not a player.");

View File

@ -8,7 +8,7 @@
#include "textbox.h"
#include "assert/assert.h"
#include "input.h"
#include "time.h"
#include "game/time.h"
textbox_t TEXTBOX;