Rename 'State' to 'Cursor'
This commit is contained in:
@@ -32,23 +32,14 @@ namespace JabyEngine {
|
||||
}
|
||||
};
|
||||
|
||||
struct State {
|
||||
struct Cursor {
|
||||
GPU::PositionI16 pos;
|
||||
uint8_t wiggle_count;
|
||||
|
||||
static constexpr State create(GPU::PositionI16 pos, uint8_t wiggle_count = 0) {
|
||||
return State{.pos = pos, .wiggle_count = wiggle_count};
|
||||
static constexpr Cursor create(GPU::PositionI16 pos, uint8_t wiggle_count = 0) {
|
||||
return Cursor{.pos = pos, .wiggle_count = wiggle_count};
|
||||
}
|
||||
};
|
||||
|
||||
using Wiggle = GPU::PositionI8[8];
|
||||
|
||||
/*struct Wiggle {
|
||||
GPU::PositionI8 offset[8];
|
||||
uint8_t count;
|
||||
|
||||
GPU::PositionI8 next() {
|
||||
return this->offset[(this->count++)&0x7];
|
||||
}
|
||||
};*/
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ namespace JabyEngine {
|
||||
#define __write_impl(start, color, wiggle) \
|
||||
va_list list; \
|
||||
va_start(list, start); \
|
||||
FontWriter::write(state, str, color, wiggle, list); \
|
||||
FontWriter::write(cursor, str, color, wiggle, list); \
|
||||
va_end(list)
|
||||
|
||||
GPU::TexPage::Linked tex_page[2];
|
||||
@@ -36,16 +36,16 @@ namespace JabyEngine {
|
||||
|
||||
void clear();
|
||||
|
||||
void write(State& state, const char* str, ...) {
|
||||
void write(Cursor& cursor, const char* str, ...) {
|
||||
__write_impl(str, GPU::Color24::Grey(), nullptr);
|
||||
}
|
||||
void write(State& state, const char* str, GPU::Color24 color, ...) {
|
||||
void write(Cursor& cursor, const char* str, GPU::Color24 color, ...) {
|
||||
__write_impl(color, color, nullptr);
|
||||
}
|
||||
void write(State& state, const char* str, GPU::Color24 color, const Wiggle* wiggle, ...) {
|
||||
void write(Cursor& cursor, const char* str, GPU::Color24 color, const Wiggle* wiggle, ...) {
|
||||
__write_impl(wiggle, color, wiggle);
|
||||
}
|
||||
void write(State& state, const char* str, GPU::Color24 color, const Wiggle* wiggle, va_list list);
|
||||
void write(Cursor& cursor, const char* str, GPU::Color24 color, const Wiggle* wiggle, va_list list);
|
||||
void render();
|
||||
|
||||
#undef __write_impl
|
||||
|
Reference in New Issue
Block a user