Ensure linux terminal is still working
This commit is contained in:
@ -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
|
||||
)
|
@ -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;
|
||||
|
||||
|
@ -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.");
|
||||
|
13
src/dawn/game/CMakeLists.txt
Normal file
13
src/dawn/game/CMakeLists.txt
Normal 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
|
||||
)
|
@ -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:
|
@ -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;
|
@ -5,7 +5,7 @@
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "time.h"
|
||||
#include "game/time.h"
|
||||
#include "assert/assert.h"
|
||||
|
||||
dawntime_t TIME;
|
@ -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(
|
||||
|
@ -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.");
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "textbox.h"
|
||||
#include "assert/assert.h"
|
||||
#include "input.h"
|
||||
#include "time.h"
|
||||
#include "game/time.h"
|
||||
|
||||
textbox_t TEXTBOX;
|
||||
|
||||
|
Reference in New Issue
Block a user