Nuked console
This commit is contained in:
@@ -10,5 +10,4 @@ target_sources(${DUSK_TARGET_NAME}
|
||||
uitext.c
|
||||
uifps.c
|
||||
uiframe.c
|
||||
uiconsole.c
|
||||
)
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "ui.h"
|
||||
#include "ui/uiconsole.h"
|
||||
#include "ui/uifps.h"
|
||||
#include "util/memory.h"
|
||||
#include "display/tileset/tileset_minogram.h"
|
||||
@@ -38,7 +37,6 @@ void uiRender(void) {
|
||||
|
||||
// Render UI elements here
|
||||
if(UI.font) {
|
||||
uiConsoleRender(0, 0, UI.fontTileset, &UI.font->alphaImage.texture);
|
||||
uiFPSRender(UI.fontTileset, &UI.font->alphaImage.texture);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "uiconsole.h"
|
||||
#include "uitext.h"
|
||||
#include "console/console.h"
|
||||
|
||||
void uiConsoleRender(
|
||||
const float_t x,
|
||||
const float_t y,
|
||||
const tileset_t *tileset,
|
||||
texture_t *texture
|
||||
) {
|
||||
if(!CONSOLE.visible) return;
|
||||
|
||||
int32_t i = CONSOLE_HISTORY_MAX - 1;
|
||||
char_t *line;
|
||||
do {
|
||||
line = CONSOLE.line[i];
|
||||
if(line[0] == '\0') {
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
uiTextDraw(
|
||||
x, y + (i * tileset->tileHeight),
|
||||
line, COLOR_WHITE,
|
||||
tileset, texture
|
||||
);
|
||||
i--;
|
||||
} while(i > 0);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "display/tileset/tileset.h"
|
||||
#include "display/texture.h"
|
||||
|
||||
/**
|
||||
* Renders the console UI.
|
||||
*
|
||||
* @param x The x-coordinate to start rendering the console.
|
||||
* @param y The y-coordinate to start rendering the console.
|
||||
* @param tileset The tileset to use for rendering text.
|
||||
* @param texture The texture associated with the tileset.
|
||||
*/
|
||||
void uiConsoleRender(
|
||||
const float_t x,
|
||||
const float_t y,
|
||||
const tileset_t *tileset,
|
||||
texture_t *texture
|
||||
);
|
||||
@@ -7,16 +7,15 @@
|
||||
|
||||
#include "uifps.h"
|
||||
#include "time/time.h"
|
||||
#include "console/console.h"
|
||||
#include "util/string.h"
|
||||
#include "ui/uitext.h"
|
||||
#include "display/screen.h"
|
||||
#include "display/spritebatch.h"
|
||||
|
||||
bool_t UI_FPS_DRAW = true;
|
||||
|
||||
void uiFPSRender(const tileset_t *tileset, texture_t *texture) {
|
||||
if(stringCompare(consoleVarGet("fps")->value, "0") == 0) {
|
||||
return;
|
||||
}
|
||||
if(!UI_FPS_DRAW) return;
|
||||
|
||||
float_t fps = TIME.delta > 0.0f ? (1.0f / TIME.delta) : 0.0f;
|
||||
char_t buffer[64];
|
||||
|
||||
Reference in New Issue
Block a user