Moving some logic into separate files

This commit is contained in:
2024-10-08 09:36:15 -05:00
parent 9f4cb283c1
commit 825cc88e17
21 changed files with 261 additions and 21 deletions

View File

@ -8,6 +8,7 @@
# Sources
target_sources(${DAWN_TARGET_NAME}
PRIVATE
drawstatemainmenu.c
drawstateoverworld.c
drawmap.c
drawtext.c

View File

@ -0,0 +1,14 @@
/**
* Copyright (c) 2024 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "drawstatemainmenu.h"
#include "display/draw/drawtext.h"
void drawStateMainMenu() {
// Draw the logo
drawText("Dawn", 4, 0, 0, COLOR_WHITE);
}

View File

@ -0,0 +1,14 @@
/**
* Copyright (c) 2024 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "display/frame.h"
/**
* Draws the main menu state.
*/
void drawStateMainMenu();

View File

@ -27,14 +27,14 @@ void drawStateOverworld() {
cameraPositionY = player->y;
}
// drawMap(
// GAME.currentMap,
// cameraPositionX, cameraPositionY,
// 0, 0,
// FRAME_WIDTH, FRAME_HEIGHT
// );
drawMap(
GAME.currentMap,
cameraPositionX, cameraPositionY,
0, 0,
FRAME_WIDTH, FRAME_HEIGHT
);
// Draw UI
// drawUITextbox();
drawUITestMenu();
drawUITextbox();
// drawUITestMenu();
}